Skip to content

Commit

Permalink
Make regex dependency optional in datafusion-functions, add CI checks…
Browse files Browse the repository at this point in the history
… for function packages (apache#9473)

* Make regex dependency optional in datafusion-functions

* Add missing cargo-check tests in CI

* make it optional

* remove uncessary core expressions

* add missing dependency

* format toml
  • Loading branch information
alamb authored Mar 7, 2024
1 parent e5404a1 commit 8d58b03
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,20 @@ jobs:

# Ensure that the datafusion crate can be built with only a subset of the function
# packages enabled.
- name: Check function packages (array_expressions)
run: cargo check --no-default-features --features=array_expressions -p datafusion

- name: Check function packages (datetime_expressions)
run: cargo check --no-default-features --features=datetime_expressions -p datafusion

- name: Check function packages (encoding_expressions)
run: cargo check --no-default-features --features=encoding_expressions -p datafusion

- name: Check function packages (math_expressions)
run: cargo check --no-default-features --features=math_expressions -p datafusion

- name: Check function packages (array_expressions)
run: cargo check --no-default-features --features=array_expressions -p datafusion

- name: Check function packages (datetime_expressions)
run: cargo check --no-default-features --features=datetime_expressions -p datafusion
- name: Check function packages (regex_expressions)
run: cargo check --no-default-features --features=regex_expressions -p datafusion

- name: Check Cargo.lock for datafusion-cli
run: |
Expand Down
6 changes: 5 additions & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ force_hash_collisions = []
math_expressions = ["datafusion-functions/math_expressions"]
parquet = ["datafusion-common/parquet", "dep:parquet"]
pyarrow = ["datafusion-common/pyarrow", "parquet"]
regex_expressions = ["datafusion-physical-expr/regex_expressions", "datafusion-optimizer/regex_expressions"]
regex_expressions = [
"datafusion-physical-expr/regex_expressions",
"datafusion-optimizer/regex_expressions",
"datafusion-functions/regex_expressions",
]
serde = ["arrow-schema/serde"]
unicode_expressions = [
"datafusion-physical-expr/unicode_expressions",
Expand Down
6 changes: 4 additions & 2 deletions datafusion/functions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ default = ["core_expressions", "datetime_expressions", "encoding_expressions", "
encoding_expressions = ["base64", "hex"]
# enable math functions
math_expressions = []
regex_expressions = []
# enable regular expressions
regex_expressions = ["regex"]

[lib]
name = "datafusion_functions"
Expand All @@ -59,7 +60,8 @@ datafusion-physical-expr = { workspace = true, default-features = true }
hex = { version = "0.4", optional = true }
itertools = { workspace = true }
log = { workspace = true }
regex = { version = "1.8" }
regex = { version = "1.8", optional = true }

[dev-dependencies]
criterion = "0.5"
rand = { workspace = true }
Expand Down

0 comments on commit 8d58b03

Please sign in to comment.