Skip to content

Commit 91b5469

Browse files
authored
Fix build with --no-default-features (#1219)
* Check build works without default features * Fix lazy static use
1 parent 75b8112 commit 91b5469

5 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/rust.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ jobs:
6464
env:
6565
CARGO_HOME: "/github/home/.cargo"
6666
CARGO_TARGET_DIR: "/github/home/target"
67+
- name: Check DataFusion Build without default features
68+
run: |
69+
cargo check --no-default-features -p datafusion
70+
env:
71+
CARGO_HOME: "/github/home/.cargo"
72+
CARGO_TARGET_DIR: "/github/home/target"
6773

6874
# test the crate
6975
linux-test:

datafusion/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ path = "src/lib.rs"
4141
default = ["crypto_expressions", "regex_expressions", "unicode_expressions"]
4242
simd = ["arrow/simd"]
4343
crypto_expressions = ["md-5", "sha2", "blake2", "blake3"]
44-
regex_expressions = ["regex", "lazy_static"]
44+
regex_expressions = ["regex"]
4545
unicode_expressions = ["unicode-segmentation"]
4646
# Used for testing ONLY: causes all values to hash to the same value (test for collisions)
4747
force_hash_collisions = []
@@ -70,7 +70,7 @@ blake3 = { version = "1.0", optional = true }
7070
ordered-float = "2.0"
7171
unicode-segmentation = { version = "^1.7.1", optional = true }
7272
regex = { version = "^1.4.3", optional = true }
73-
lazy_static = { version = "^1.4.0", optional = true }
73+
lazy_static = { version = "^1.4.0" }
7474
smallvec = { version = "1.6", features = ["union"] }
7575
rand = "0.8"
7676
avro-rs = { version = "0.13", features = ["snappy"], optional = true }

datafusion/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,5 @@ pub(crate) mod field_util;
236236
pub mod test;
237237
pub mod test_util;
238238

239-
#[macro_use]
240-
#[cfg(feature = "regex_expressions")]
241-
extern crate lazy_static;
242-
243239
#[cfg(doctest)]
244240
doc_comment::doctest!("../../README.md", readme_example_test);

datafusion/src/physical_plan/file_format/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use crate::{
3939
datasource::{object_store::ObjectStore, PartitionedFile},
4040
scalar::ScalarValue,
4141
};
42+
use lazy_static::lazy_static;
4243
use std::{
4344
collections::HashMap,
4445
fmt::{Display, Formatter, Result as FmtResult},

datafusion/src/physical_plan/regex_expressions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use crate::error::{DataFusionError, Result};
2828
use arrow::array::{ArrayRef, GenericStringArray, StringOffsetSizeTrait};
2929
use arrow::compute;
3030
use hashbrown::HashMap;
31+
use lazy_static::lazy_static;
3132
use regex::Regex;
3233

3334
macro_rules! downcast_string_arg {

0 commit comments

Comments
 (0)