Skip to content

Commit 8d58b03

Browse files
authored
Make regex dependency optional in datafusion-functions, add CI checks for function packages (#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
1 parent e5404a1 commit 8d58b03

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,20 @@ jobs:
7979

8080
# Ensure that the datafusion crate can be built with only a subset of the function
8181
# packages enabled.
82+
- name: Check function packages (array_expressions)
83+
run: cargo check --no-default-features --features=array_expressions -p datafusion
84+
85+
- name: Check function packages (datetime_expressions)
86+
run: cargo check --no-default-features --features=datetime_expressions -p datafusion
87+
8288
- name: Check function packages (encoding_expressions)
8389
run: cargo check --no-default-features --features=encoding_expressions -p datafusion
8490

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

88-
- name: Check function packages (array_expressions)
89-
run: cargo check --no-default-features --features=array_expressions -p datafusion
90-
91-
- name: Check function packages (datetime_expressions)
92-
run: cargo check --no-default-features --features=datetime_expressions -p datafusion
94+
- name: Check function packages (regex_expressions)
95+
run: cargo check --no-default-features --features=regex_expressions -p datafusion
9396

9497
- name: Check Cargo.lock for datafusion-cli
9598
run: |

datafusion/core/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ force_hash_collisions = []
6060
math_expressions = ["datafusion-functions/math_expressions"]
6161
parquet = ["datafusion-common/parquet", "dep:parquet"]
6262
pyarrow = ["datafusion-common/pyarrow", "parquet"]
63-
regex_expressions = ["datafusion-physical-expr/regex_expressions", "datafusion-optimizer/regex_expressions"]
63+
regex_expressions = [
64+
"datafusion-physical-expr/regex_expressions",
65+
"datafusion-optimizer/regex_expressions",
66+
"datafusion-functions/regex_expressions",
67+
]
6468
serde = ["arrow-schema/serde"]
6569
unicode_expressions = [
6670
"datafusion-physical-expr/unicode_expressions",

datafusion/functions/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ default = ["core_expressions", "datetime_expressions", "encoding_expressions", "
3939
encoding_expressions = ["base64", "hex"]
4040
# enable math functions
4141
math_expressions = []
42-
regex_expressions = []
42+
# enable regular expressions
43+
regex_expressions = ["regex"]
4344

4445
[lib]
4546
name = "datafusion_functions"
@@ -59,7 +60,8 @@ datafusion-physical-expr = { workspace = true, default-features = true }
5960
hex = { version = "0.4", optional = true }
6061
itertools = { workspace = true }
6162
log = { workspace = true }
62-
regex = { version = "1.8" }
63+
regex = { version = "1.8", optional = true }
64+
6365
[dev-dependencies]
6466
criterion = "0.5"
6567
rand = { workspace = true }

0 commit comments

Comments
 (0)