Skip to content

Commit

Permalink
Fix build with --no-default-features (#1219)
Browse files Browse the repository at this point in the history
* Check build works without default features

* Fix lazy static use
  • Loading branch information
alamb authored Nov 2, 2021
1 parent 75b8112 commit 91b5469
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"
- name: Check DataFusion Build without default features
run: |
cargo check --no-default-features -p datafusion
env:
CARGO_HOME: "/github/home/.cargo"
CARGO_TARGET_DIR: "/github/home/target"

# test the crate
linux-test:
Expand Down
4 changes: 2 additions & 2 deletions datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ path = "src/lib.rs"
default = ["crypto_expressions", "regex_expressions", "unicode_expressions"]
simd = ["arrow/simd"]
crypto_expressions = ["md-5", "sha2", "blake2", "blake3"]
regex_expressions = ["regex", "lazy_static"]
regex_expressions = ["regex"]
unicode_expressions = ["unicode-segmentation"]
# Used for testing ONLY: causes all values to hash to the same value (test for collisions)
force_hash_collisions = []
Expand Down Expand Up @@ -70,7 +70,7 @@ blake3 = { version = "1.0", optional = true }
ordered-float = "2.0"
unicode-segmentation = { version = "^1.7.1", optional = true }
regex = { version = "^1.4.3", optional = true }
lazy_static = { version = "^1.4.0", optional = true }
lazy_static = { version = "^1.4.0" }
smallvec = { version = "1.6", features = ["union"] }
rand = "0.8"
avro-rs = { version = "0.13", features = ["snappy"], optional = true }
Expand Down
4 changes: 0 additions & 4 deletions datafusion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,5 @@ pub(crate) mod field_util;
pub mod test;
pub mod test_util;

#[macro_use]
#[cfg(feature = "regex_expressions")]
extern crate lazy_static;

#[cfg(doctest)]
doc_comment::doctest!("../../README.md", readme_example_test);
1 change: 1 addition & 0 deletions datafusion/src/physical_plan/file_format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use crate::{
datasource::{object_store::ObjectStore, PartitionedFile},
scalar::ScalarValue,
};
use lazy_static::lazy_static;
use std::{
collections::HashMap,
fmt::{Display, Formatter, Result as FmtResult},
Expand Down
1 change: 1 addition & 0 deletions datafusion/src/physical_plan/regex_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::error::{DataFusionError, Result};
use arrow::array::{ArrayRef, GenericStringArray, StringOffsetSizeTrait};
use arrow::compute;
use hashbrown::HashMap;
use lazy_static::lazy_static;
use regex::Regex;

macro_rules! downcast_string_arg {
Expand Down

0 comments on commit 91b5469

Please sign in to comment.