Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Integration test documentation and expanded tests #133

Merged
merged 1 commit into from
Apr 28, 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
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ There are integration tests against parquet files generated by pyarrow.
To run then, you will need to run

```bash
cd integration-tests
python3 -m venv venv
venv/bin/pip install pip --upgrade
venv/bin/pip install pyarrow==4
venv/bin/python integration/write_pyarrow.py
venv/bin/pip install pyarrow==7
venv/bin/python tests/write_pyarrow.py
cargo test
```

before. This is only needed once (per change in the `integration-tests/integration/write_pyarrow.py`).
before. This is only needed once (per change in the `tests/write_pyarrow.py`).

## How to implement page readers

Expand Down
33 changes: 17 additions & 16 deletions tests/it/read/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,7 @@ pub fn read_column<R: std::io::Read + std::io::Seek>(
.fields()
.iter()
.enumerate()
.filter_map(|(i, x)| {
println!("{}", x.name());
if x.name() == field {
Some(i)
} else {
None
}
})
.filter_map(|(i, x)| if x.name() == field { Some(i) } else { None })
.next()
.unwrap();

Expand Down Expand Up @@ -153,14 +146,7 @@ pub async fn read_column_async<
.fields()
.iter()
.enumerate()
.filter_map(|(i, x)| {
println!("{}", x.name());
if x.name() == field {
Some(i)
} else {
None
}
})
.filter_map(|(i, x)| if x.name() == field { Some(i) } else { None })
.next()
.unwrap();

Expand Down Expand Up @@ -407,6 +393,16 @@ fn pyarrow_v1_non_dict_int64_optional() -> Result<()> {
test_pyarrow_integration("basic", "int64", 1, false, false, "")
}

#[test]
fn pyarrow_v1_non_dict_int64_optional_brotli() -> Result<()> {
test_pyarrow_integration("basic", "int64", 1, false, false, "/brotli")
}

#[test]
fn pyarrow_v1_non_dict_int64_optional_gzip() -> Result<()> {
test_pyarrow_integration("basic", "int64", 1, false, false, "/gzip")
}

#[test]
fn pyarrow_v1_non_dict_int64_optional_snappy() -> Result<()> {
test_pyarrow_integration("basic", "int64", 1, false, false, "/snappy")
Expand All @@ -417,6 +413,11 @@ fn pyarrow_v1_non_dict_int64_optional_lz4() -> Result<()> {
test_pyarrow_integration("basic", "int64", 1, false, false, "/lz4")
}

#[test]
fn pyarrow_v1_non_dict_int64_optional_zstd() -> Result<()> {
test_pyarrow_integration("basic", "int64", 1, false, false, "/zstd")
}

#[test]
fn pyarrow_v2_non_dict_int64_optional() -> Result<()> {
test_pyarrow_integration("basic", "int64", 2, false, false, "")
Expand Down
2 changes: 1 addition & 1 deletion tests/write_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,5 @@ def write_pyarrow(
for case in [case_basic_nullable, case_basic_required, case_nested, case_struct]:
for version in [1, 2]:
for use_dict in [False, True]:
for compression in [None, "snappy", "lz4"]:
for compression in [None, "brotli", "lz4", "gzip", "snappy", "zstd"]:
write_pyarrow(case, 1, version, use_dict, compression)