Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ include = ["/src", "/datafusion", "/LICENSE.txt", "pyproject.toml", "Cargo.toml"
[features]
default = ["mimalloc"]
protoc = [ "datafusion-substrait/protoc" ]
substrait = ["dep:datafusion-substrait"]

[dependencies]
tokio = { version = "1.24", features = ["macros", "rt", "rt-multi-thread", "sync"] }
Expand All @@ -41,7 +42,7 @@ datafusion-common = { version = "32.0.0", features = ["pyarrow"] }
datafusion-expr = { version = "32.0.0" }
datafusion-optimizer = { version = "32.0.0" }
datafusion-sql = { version = "32.0.0" }
datafusion-substrait = { version = "32.0.0" }
datafusion-substrait = { version = "32.0.0", optional = true }
prost = "0.11"
prost-types = "0.11"
uuid = { version = "1.3", features = ["v4"] }
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ include = [
exclude = [".github/**", "ci/**", ".asf.yaml"]
# Require Cargo.lock is up to date
locked = true
features = ["substrait"]
13 changes: 12 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub use datafusion_common;
pub use datafusion_expr;
pub use datafusion_optimizer;
pub use datafusion_sql;

#[cfg(feature = "substrait")]
pub use datafusion_substrait;

#[allow(clippy::borrow_deref_ref)]
Expand All @@ -48,6 +50,8 @@ mod pyarrow_filter_expression;
mod record_batch;
pub mod sql;
pub mod store;

#[cfg(feature = "substrait")]
pub mod substrait;
#[allow(clippy::borrow_deref_ref)]
mod udaf;
Expand Down Expand Up @@ -108,9 +112,16 @@ fn _internal(py: Python, m: &PyModule) -> PyResult<()> {
m.add_submodule(store)?;

// Register substrait as a submodule
#[cfg(feature = "substrait")]
setup_substrait_module(py, m)?;

Ok(())
}

#[cfg(feature = "substrait")]
fn setup_substrait_module(py: Python, m: &PyModule) -> PyResult<()> {
let substrait = PyModule::new(py, "substrait")?;
substrait::init_module(substrait)?;
m.add_submodule(substrait)?;

Ok(())
}