Skip to content

Commit

Permalink
fix(rust): add missing feature flags on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Sep 25, 2023
1 parent 14823ba commit 20247e5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/polars-lazy/src/tests/aggregations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn test_agg_unique_first() -> PolarsResult<()> {
}

#[test]
#[cfg(feature = "csv")]
fn test_lazy_agg_scan() {
let lf = scan_foods_csv;
let df = lf().min().collect().unwrap();
Expand Down
11 changes: 7 additions & 4 deletions crates/polars-lazy/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ fn init_files() {

match ext {
".parquet" => {
ParquetWriter::new(f)
.with_statistics(true)
.finish(&mut df)
.unwrap();
#[cfg(feature = "parquet")]
{
ParquetWriter::new(f)
.with_statistics(true)
.finish(&mut df)
.unwrap();
}
},
".ipc" => {
IpcWriter::new(f).finish(&mut df).unwrap();
Expand Down
5 changes: 5 additions & 0 deletions crates/polars-lazy/src/tests/optimization_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ fn test_no_left_join_pass() -> PolarsResult<()> {
}

#[test]
#[cfg(feature = "parquet")]
pub fn test_simple_slice() -> PolarsResult<()> {
let _guard = SINGLE_LOCK.lock().unwrap();
let q = scan_foods_parquet(false).limit(3);
Expand All @@ -185,6 +186,7 @@ pub fn test_simple_slice() -> PolarsResult<()> {
}

#[test]
#[cfg(feature = "parquet")]
#[cfg(feature = "cse")]
pub fn test_slice_pushdown_join() -> PolarsResult<()> {
let _guard = SINGLE_LOCK.lock().unwrap();
Expand Down Expand Up @@ -221,6 +223,7 @@ pub fn test_slice_pushdown_join() -> PolarsResult<()> {
}

#[test]
#[cfg(feature = "parquet")]
pub fn test_slice_pushdown_group_by() -> PolarsResult<()> {
let _guard = SINGLE_LOCK.lock().unwrap();
let q = scan_foods_parquet(false).limit(100);
Expand Down Expand Up @@ -250,6 +253,7 @@ pub fn test_slice_pushdown_group_by() -> PolarsResult<()> {
}

#[test]
#[cfg(feature = "parquet")]
pub fn test_slice_pushdown_sort() -> PolarsResult<()> {
let _guard = SINGLE_LOCK.lock().unwrap();
let q = scan_foods_parquet(false).limit(100);
Expand Down Expand Up @@ -546,6 +550,7 @@ fn test_with_column_prune() -> PolarsResult<()> {
}

#[test]
#[cfg(feature = "csv")]
fn test_slice_at_scan_group_by() -> PolarsResult<()> {
let ldf = scan_foods_csv();

Expand Down
1 change: 1 addition & 0 deletions crates/polars-lazy/src/tests/predicate_queries.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::*;

#[test]
#[cfg(feature = "parquet")]
fn test_multiple_roots() -> PolarsResult<()> {
let mut expr_arena = Arena::with_capacity(16);
let mut lp_arena = Arena::with_capacity(8);
Expand Down
2 changes: 2 additions & 0 deletions crates/polars-lazy/src/tests/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ fn test_lazy_query_2() {
}

#[test]
#[cfg(feature = "csv")]
fn test_lazy_query_3() {
// query checks if schema of scanning is not changed by aggregation
let _ = scan_foods_csv()
Expand Down Expand Up @@ -643,6 +644,7 @@ fn test_type_coercion() {
}

#[test]
#[cfg(feature = "csv")]
fn test_lazy_partition_agg() {
let df = df! {
"foo" => &[1, 1, 2, 2, 3],
Expand Down

0 comments on commit 20247e5

Please sign in to comment.