From d5cc0dba5d03510d976a0289d044b585299538a1 Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Fri, 17 Sep 2021 17:24:09 +0200 Subject: [PATCH] Added `io_csv_read` and `io_csv_write` feature (#408) --- Cargo.toml | 4 +++- src/io/csv/mod.rs | 4 ++++ src/io/mod.rs | 2 +- src/util/mod.rs | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 89414f39630..22ed05de4db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,9 @@ full = [ "chrono-tz", ] merge_sort = ["itertools"] -io_csv = ["csv", "lazy_static", "regex", "lexical-core", "streaming-iterator"] +io_csv = ["io_csv_read", "io_csv_write"] +io_csv_read = ["csv", "lazy_static", "regex", "lexical-core"] +io_csv_write = ["csv", "streaming-iterator", "lexical-core"] io_json = ["serde", "serde_json", "indexmap"] io_ipc = ["flatbuffers"] io_ipc_compression = ["lz4", "zstd"] diff --git a/src/io/csv/mod.rs b/src/io/csv/mod.rs index bafc5b4c673..4fe139c8dea 100644 --- a/src/io/csv/mod.rs +++ b/src/io/csv/mod.rs @@ -16,5 +16,9 @@ impl From for ArrowError { } } +#[cfg(feature = "io_csv_read")] +#[cfg_attr(docsrs, doc(cfg(feature = "io_csv_read")))] pub mod read; +#[cfg(feature = "io_csv_write")] +#[cfg_attr(docsrs, doc(cfg(feature = "io_csv_write")))] pub mod write; diff --git a/src/io/mod.rs b/src/io/mod.rs index 94c7a2f471b..1ad0c3b4598 100644 --- a/src/io/mod.rs +++ b/src/io/mod.rs @@ -1,5 +1,5 @@ //! Interact with different formats such as Arrow, CSV, parquet, etc. -#[cfg(feature = "io_csv")] +#[cfg(any(feature = "io_csv_read", feature = "io_csv_write"))] #[cfg_attr(docsrs, doc(cfg(feature = "io_csv")))] pub mod csv; diff --git a/src/util/mod.rs b/src/util/mod.rs index 996134d35a6..b608f96c269 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1,8 +1,8 @@ //! Misc utilities used in different places in the crate. -#[cfg(any(feature = "compute", feature = "io_csv"))] +#[cfg(any(feature = "compute", feature = "io_csv_write", feature = "io_csv_read"))] mod lexical; -#[cfg(any(feature = "compute", feature = "io_csv"))] +#[cfg(any(feature = "compute", feature = "io_csv_write", feature = "io_csv_read"))] pub use lexical::*; #[cfg(feature = "benchmarks")]