This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 5faa10b291 fix: skip compression tests on --no-default-features (#7172)
5faa10b291 is described below
commit 5faa10b2911ecca4c2199f78ae675363c7d8230e
Author: Martin Fischer <[email protected]>
AuthorDate: Wed Aug 2 05:55:58 2023 +0200
fix: skip compression tests on --no-default-features (#7172)
Previously `cargo test -p datafusion --no-default-features --lib`
failed with 77 tests panicking with the message:
> Compression is not supported in this build
This commit fixes this test failure under --no-default-features
by excluding the tests via `#[cfg(feature = "compression")]`.
---
datafusion/core/src/datasource/file_format/csv.rs | 3 +++
datafusion/core/src/datasource/physical_plan/csv.rs | 6 ++++++
datafusion/core/src/datasource/physical_plan/json.rs | 5 +++++
3 files changed, 14 insertions(+)
diff --git a/datafusion/core/src/datasource/file_format/csv.rs
b/datafusion/core/src/datasource/file_format/csv.rs
index ee67003d2f..8df9a86b1e 100644
--- a/datafusion/core/src/datasource/file_format/csv.rs
+++ b/datafusion/core/src/datasource/file_format/csv.rs
@@ -815,6 +815,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn query_compress_data(
file_compression_type: FileCompressionType,
@@ -869,6 +870,7 @@ mod tests {
Ok(())
}
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn query_compress_csv() -> Result<()> {
let ctx = SessionContext::new();
@@ -1021,6 +1023,7 @@ mod tests {
}
#[rstest(n_partitions, case(1), case(2), case(3), case(4))]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn test_csv_parallel_compressed(n_partitions: usize) -> Result<()> {
let config = SessionConfig::new()
diff --git a/datafusion/core/src/datasource/physical_plan/csv.rs
b/datafusion/core/src/datasource/physical_plan/csv.rs
index 6ef92bed4a..7b763855a6 100644
--- a/datafusion/core/src/datasource/physical_plan/csv.rs
+++ b/datafusion/core/src/datasource/physical_plan/csv.rs
@@ -667,6 +667,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn csv_exec_with_projection(
file_compression_type: FileCompressionType,
@@ -730,6 +731,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn csv_exec_with_mixed_order_projection(
file_compression_type: FileCompressionType,
@@ -793,6 +795,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn csv_exec_with_limit(
file_compression_type: FileCompressionType,
@@ -856,6 +859,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn csv_exec_with_missing_column(
file_compression_type: FileCompressionType,
@@ -907,6 +911,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn csv_exec_with_partition(
file_compression_type: FileCompressionType,
@@ -1056,6 +1061,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn test_chunked_csv(
file_compression_type: FileCompressionType,
diff --git a/datafusion/core/src/datasource/physical_plan/json.rs
b/datafusion/core/src/datasource/physical_plan/json.rs
index 327a10f5c3..987bb83687 100644
--- a/datafusion/core/src/datasource/physical_plan/json.rs
+++ b/datafusion/core/src/datasource/physical_plan/json.rs
@@ -426,6 +426,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn nd_json_exec_file_without_projection(
file_compression_type: FileCompressionType,
@@ -497,6 +498,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn nd_json_exec_file_with_missing_column(
file_compression_type: FileCompressionType,
@@ -550,6 +552,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn nd_json_exec_file_projection(
file_compression_type: FileCompressionType,
@@ -601,6 +604,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn nd_json_exec_file_mixed_order_projection(
file_compression_type: FileCompressionType,
@@ -712,6 +716,7 @@ mod tests {
case(FileCompressionType::XZ),
case(FileCompressionType::ZSTD)
)]
+ #[cfg(feature = "compression")]
#[tokio::test]
async fn test_chunked_json(
file_compression_type: FileCompressionType,