Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Described how to run part of the tests #762

Merged
merged 2 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
51 changes: 0 additions & 51 deletions src/io/parquet/read/schema/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<Schema>> {
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::<Vec<_>>();
assert_eq!(
names,
vec![
"int64",
"float64",
"string",
"bool",
"date",
"uint32",
"string_large",
"decimal_9",
"decimal_18",
"decimal_26",
"timestamp_us"
]
);
Ok(())
}
}