Skip to content

Commit

Permalink
refactor: make object_store optional
Browse files Browse the repository at this point in the history
  • Loading branch information
wjones127 committed Sep 17, 2023
1 parent 5b85fce commit 61ae63d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 279 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: build and lint with clippy
run: cargo clippy --tests -- -D warnings
- name: lint without default features
run: cargo clippy --no-default--features -- -D warnings
test:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 2 additions & 3 deletions kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ either = "1.8"
fix-hidden-lifetime-bug = "0.2"
itertools = "0.11"
lazy_static = "1.4"
# used for providing a storage abstraction layer
object_store = "^0.7.0"
# need to generalize over arrow, arrow2 and diff parquet etc. (BYOP)
regex = "1.8"
roaring = "0.10.1"
Expand All @@ -37,14 +35,15 @@ z85 = "3.0.5"

# Used in default client
futures = { version = "0.3", optional = true }
object_store = { version = "^0.7.0", optional = true }
parquet = { version = "^46.0", optional = true, features=["async", "object_store"]}

# optionally used with default client (though not required)
tokio = { version = "1", optional = true, features=["rt-multi-thread"] }

[features]
default = ["default-client"]
default-client = ["chrono", "parquet", "futures"]
default-client = ["chrono", "futures", "object_store", "parquet"]

[dev-dependencies]
arrow = { version = "^46.0", features = ["json", "prettyprint"] }
Expand Down
1 change: 1 addition & 0 deletions kernel/src/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use itertools::izip;

use crate::{DeltaResult, Error};

pub(crate) mod arrow;
pub(crate) mod schemas;
pub(crate) mod types;

Expand Down
275 changes: 0 additions & 275 deletions kernel/src/client/arrow.rs

This file was deleted.

1 change: 0 additions & 1 deletion kernel/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::{
DeltaResult, ExpressionHandler, FileSystemClient, JsonHandler, ParquetHandler, TableClient,
};

pub mod arrow;
pub mod executor;
pub mod file_handler;
pub mod filesystem;
Expand Down
3 changes: 3 additions & 0 deletions kernel/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ pub enum Error {
source: Box<dyn std::error::Error + Send + Sync + 'static>,
},

#[cfg(feature = "parquet")]
#[error("Arrow error: {0}")]
Parquet(#[from] parquet::errors::ParquetError),

#[cfg(feature = "object_store")]
#[error("Error interacting with object store: {0}")]
ObjectStore(object_store::Error),

Expand Down Expand Up @@ -48,6 +50,7 @@ pub enum Error {
MissingMetadata,
}

#[cfg(feature = "object_store")]
impl From<object_store::Error> for Error {
fn from(value: object_store::Error) -> Self {
match value {
Expand Down

0 comments on commit 61ae63d

Please sign in to comment.