Skip to content

Commit

Permalink
Explicitly mark parquet for tests in datafusion-common (#8497)
Browse files Browse the repository at this point in the history
* Add cfg for test and reference requiring parquet

* Check datafusion-common can be compiled without parquet

* Update rust.yml

* Remove unnecessary space
  • Loading branch information
Dennis40816 authored Dec 12, 2023
1 parent 7f312c8 commit 2919e32
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
- name: Check workspace without default features
run: cargo check --no-default-features -p datafusion

- name: Check datafusion-common without default features
run: cargo check --tests --no-default-features -p datafusion-common

- name: Check workspace in debug mode
run: cargo check

Expand Down
1 change: 1 addition & 0 deletions datafusion/common/src/file_options/file_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ mod tests {
use std::str::FromStr;

#[test]
#[cfg(feature = "parquet")]
fn from_str() {
for (ext, file_type) in [
("csv", FileType::CSV),
Expand Down
8 changes: 8 additions & 0 deletions datafusion/common/src/file_options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ impl Display for FileTypeWriterOptions {
mod tests {
use std::collections::HashMap;

#[cfg(feature = "parquet")]
use parquet::{
basic::{Compression, Encoding, ZstdLevel},
file::properties::{EnabledStatistics, WriterVersion},
Expand All @@ -313,9 +314,11 @@ mod tests {

use crate::Result;

#[cfg(feature = "parquet")]
use super::{parquet_writer::ParquetWriterOptions, StatementOptions};

#[test]
#[cfg(feature = "parquet")]
fn test_writeroptions_parquet_from_statement_options() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
option_map.insert("max_row_group_size".to_owned(), "123".to_owned());
Expand Down Expand Up @@ -386,6 +389,7 @@ mod tests {
}

#[test]
#[cfg(feature = "parquet")]
fn test_writeroptions_parquet_column_specific() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();

Expand Down Expand Up @@ -506,6 +510,8 @@ mod tests {
}

#[test]
// for StatementOptions
#[cfg(feature = "parquet")]
fn test_writeroptions_csv_from_statement_options() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
option_map.insert("header".to_owned(), "true".to_owned());
Expand Down Expand Up @@ -533,6 +539,8 @@ mod tests {
}

#[test]
// for StatementOptions
#[cfg(feature = "parquet")]
fn test_writeroptions_json_from_statement_options() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
option_map.insert("compression".to_owned(), "gzip".to_owned());
Expand Down
1 change: 1 addition & 0 deletions datafusion/common/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ mod tests {
}

#[test]
#[cfg(feature = "parquet")]
fn test_happy() {
let res = arrow_test_data();
assert!(PathBuf::from(res).is_dir());
Expand Down

0 comments on commit 2919e32

Please sign in to comment.