Repository navigation
refactor(io): Replace deprecated ParquetObjectReader with our own AsyncFileReader - #563
Merged
Merged
Conversation
`read_parquet_async` had no Python test. Write a Parquet file to a temporary directory, read it back through a `LocalStore`, and compare it with the original table, schema metadata included. `read_parquet_async` needs a running event loop when it is called, so the test awaits it inside a coroutine that it passes to `asyncio.run`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ader parquet deprecated `ParquetObjectReader` in 59.2.0 in favor of implementing `AsyncFileReader` directly, and plans to remove its object_store integration altogether (apache/arrow-rs#10308). Copy the `ObjectStoreReader` from parquet's `examples/object_store.rs` and read through it in `read_parquet_async`. This removes the `#[allow(deprecated)]`. The reader does what `ParquetObjectReader` did for us: it doesn't know the file size, so it reads the footer with suffix range requests, and it wraps object_store errors in `ParquetError::External`. The returned table, its schema metadata, and error messages are unchanged. arro3-io now enables parquet's `async` feature instead of its `object_store` feature, so parquet no longer depends on object_store. That decouples arro3-io's object_store version, which has to match pyo3-object_store's, from parquet's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
read_parquet_asyncnow reads through arro3-io's ownAsyncFileReaderinstead of parquet'sParquetObjectReader, which parquet deprecated in 59.2.0 (apache/arrow-rs#10308).arro3-io/src/object_store_reader.rsis copied from parquet 60.1'sexamples/object_store.rs, which the deprecation note points to. The only change ispub(crate)on the struct and itsnew.#[allow(deprecated)]onread_parquet_async_inneris gone.parquet/asyncinstead ofparquet/object_store, so parquet no longer depends on object_store. arro3-io's object_store version no longer has to match parquet's, only pyo3-object_store's.read_parquet_asyncgets its first test,test_read_parquet_async. The first commit adds it on its own, and it passes both before and after the change.Closes #561
Behavior
There's no behavior change for arro3. Like
ParquetObjectReaderwithout a file size, which is how arro3 used it, the new reader reads the footer with suffix range requests and makes noheadrequest. It wraps object_store errors inParquetError::External, the same as parquet'sFromimpl.A probe script gave identical output with the old and new builds. It checked the values and schema metadata of a file with two row groups, plus the errors for a missing file (in a
LocalStoreand aMemoryStore), an empty file, a 4-byte file, and a corrupt footer.Testing
ci.ymlpass locally:cargo fmt,cargo clippy --all --all-features --tests -- -D warnings,cargo check --all --all-features, andcargo test. So doescargo check -p arro3-io --no-default-features.pytest testspasses locally on Python 3.13 (macOS arm64), 209 passed. pytest-freethreaded runs each test 200 times across 10 threads there.🤖 Written by Claude Code