From d114e41d6041c7d66c3c461c7ebe76d100018bda Mon Sep 17 00:00:00 2001 From: sunadase Date: Wed, 21 Aug 2024 18:17:46 +0300 Subject: [PATCH 1/2] fix: json feature flag missing imports --- crates/polars-io/src/ndjson/core.rs | 1 + crates/polars-plan/src/plans/functions/count.rs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/polars-io/src/ndjson/core.rs b/crates/polars-io/src/ndjson/core.rs index 3390d1004b9d..5164e1e007a8 100644 --- a/crates/polars-io/src/ndjson/core.rs +++ b/crates/polars-io/src/ndjson/core.rs @@ -15,6 +15,7 @@ use crate::ndjson::buffer::*; use crate::predicates::PhysicalIoExpr; use crate::prelude::*; use crate::RowIndex; +use crate::SerReader; const NEWLINE: u8 = b'\n'; const CLOSING_BRACKET: u8 = b'}'; diff --git a/crates/polars-plan/src/plans/functions/count.rs b/crates/polars-plan/src/plans/functions/count.rs index fd92fdd9fc9d..f6177ba82a5a 100644 --- a/crates/polars-plan/src/plans/functions/count.rs +++ b/crates/polars-plan/src/plans/functions/count.rs @@ -1,6 +1,6 @@ #[cfg(feature = "ipc")] use arrow::io::ipc::read::get_row_count as count_rows_ipc_sync; -#[cfg(feature = "parquet")] +#[cfg(any(feature = "parquet", feature = "json"))] use polars_io::cloud::CloudOptions; #[cfg(feature = "csv")] use polars_io::csv::read::count_rows as count_rows_csv; @@ -10,8 +10,10 @@ use polars_io::parquet::read::ParquetAsyncReader; use polars_io::parquet::read::ParquetReader; #[cfg(all(feature = "parquet", feature = "async"))] use polars_io::pl_async::{get_runtime, with_concurrency_budget}; -#[cfg(any(feature = "parquet", feature = "ipc"))] -use polars_io::{path_utils::is_cloud_url, SerReader}; +#[cfg(any(feature = "parquet", feature = "ipc", feature = "json"))] +use polars_io::is_cloud_url; +#[cfg(feature = "json")] +use polars_io::SerReader; use super::*; From 480bbf1ade722a9867521244c9b115402d659ae1 Mon Sep 17 00:00:00 2001 From: sunadase Date: Wed, 21 Aug 2024 21:51:25 +0300 Subject: [PATCH 2/2] refactor: cargo fmt --- crates/polars-io/src/ndjson/core.rs | 3 +-- crates/polars-plan/src/plans/functions/count.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/polars-io/src/ndjson/core.rs b/crates/polars-io/src/ndjson/core.rs index 5164e1e007a8..706e49c80f42 100644 --- a/crates/polars-io/src/ndjson/core.rs +++ b/crates/polars-io/src/ndjson/core.rs @@ -14,8 +14,7 @@ use crate::mmap::{MmapBytesReader, ReaderBytes}; use crate::ndjson::buffer::*; use crate::predicates::PhysicalIoExpr; use crate::prelude::*; -use crate::RowIndex; -use crate::SerReader; +use crate::{RowIndex, SerReader}; const NEWLINE: u8 = b'\n'; const CLOSING_BRACKET: u8 = b'}'; diff --git a/crates/polars-plan/src/plans/functions/count.rs b/crates/polars-plan/src/plans/functions/count.rs index f6177ba82a5a..c8b1def29d0b 100644 --- a/crates/polars-plan/src/plans/functions/count.rs +++ b/crates/polars-plan/src/plans/functions/count.rs @@ -4,14 +4,14 @@ use arrow::io::ipc::read::get_row_count as count_rows_ipc_sync; use polars_io::cloud::CloudOptions; #[cfg(feature = "csv")] use polars_io::csv::read::count_rows as count_rows_csv; +#[cfg(any(feature = "parquet", feature = "ipc", feature = "json"))] +use polars_io::is_cloud_url; #[cfg(all(feature = "parquet", feature = "cloud"))] use polars_io::parquet::read::ParquetAsyncReader; #[cfg(feature = "parquet")] use polars_io::parquet::read::ParquetReader; #[cfg(all(feature = "parquet", feature = "async"))] use polars_io::pl_async::{get_runtime, with_concurrency_budget}; -#[cfg(any(feature = "parquet", feature = "ipc", feature = "json"))] -use polars_io::is_cloud_url; #[cfg(feature = "json")] use polars_io::SerReader;