diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 696df71734d..2eb378977b2 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,6 +4,28 @@ This crate follows the standard for developing a Rust library via `cargo`. The CI is our "ground truth" over the state of the library. Check out the different parts of the CI to understand how to test the different parts of this library locally. +## Testing + +The simplest way to test the crate is to run + +```bash +cargo test +``` + +This runs the tests of the crate without features. To run all features, use + +```bash +cargo test --features full +``` + +during development of particular parts of the crate, it is usually faster +to reduce the feature set - the tests are gated to only the relevant tests +of that feature set. For example, if improving JSON, you can use + +```bash +cargo test --features io_json +``` + ## Merging We currently do not have maintaince versions and thus only PR and merge to `main`. diff --git a/src/io/parquet/read/schema/metadata.rs b/src/io/parquet/read/schema/metadata.rs index 398e812764f..9683182def7 100644 --- a/src/io/parquet/read/schema/metadata.rs +++ b/src/io/parquet/read/schema/metadata.rs @@ -83,54 +83,3 @@ fn parse_key_value_metadata( None => None, } } - -#[cfg(test)] -mod tests { - use std::fs::File; - - use parquet2::read::read_metadata; - - use crate::datatypes::Schema; - use crate::error::Result; - - use super::read_schema_from_metadata; - - fn read_schema(path: &str) -> Result> { - let mut file = File::open(path).unwrap(); - - let metadata = read_metadata(&mut file)?; - let keys = metadata.key_value_metadata(); - read_schema_from_metadata(keys) - } - - #[test] - fn test_basic() -> Result<()> { - if std::env::var("ARROW2_IGNORE_PARQUET").is_ok() { - return Ok(()); - } - let schema = read_schema("fixtures/pyarrow3/v1/basic_nullable_10.parquet")?; - let names = schema - .unwrap() - .fields - .iter() - .map(|x| x.name.clone()) - .collect::>(); - assert_eq!( - names, - vec![ - "int64", - "float64", - "string", - "bool", - "date", - "uint32", - "string_large", - "decimal_9", - "decimal_18", - "decimal_26", - "timestamp_us" - ] - ); - Ok(()) - } -}