fix: bound Parquet storage streaming - #671
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #671 +/- ##
=======================================
Coverage 77.30% 77.30%
=======================================
Files 475 476 +1
Lines 67968 68052 +84
Branches 9347 9357 +10
=======================================
+ Hits 52541 52608 +67
- Misses 12025 12036 +11
- Partials 3402 3408 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
cofin
force-pushed
the
fix/storage-parquet-streaming
branch
from
August 1, 2026 22:39
369bcfe to
e129289
Compare
cofin
marked this pull request as ready for review
August 2, 2026 16:10
Decoding a JSONL payload failed when any single row exceeded PyArrow's default 1 MiB JSON block size, raising "ArrowInvalid: straddling object straddles two block boundaries". The reader block is now sized to the payload, so row size is bounded by the payload rather than by a fixed default. Unsupported storage formats now raise StorageCapabilityError instead of ValueError, matching the rest of the storage layer and letting callers catch a single SQLSpec error type. Requests for a batch_size that is not greater than zero remain a ValueError, since that is an argument error rather than a missing capability. Compile the Parquet streaming helpers with the rest of the storage package.
Two changes in this release alter behavior that previously succeeded, so this is a minor rather than a patch release: migration configuration now rejects keys SQLSpec does not read, and storage writes reject formats that cannot carry the payload being written. Refresh dependency locks and pre-commit hook versions.
cofin
force-pushed
the
fix/storage-parquet-streaming
branch
from
August 2, 2026 16:25
e129289 to
96a6b49
Compare
adbc-driver-postgresql refuses to start a transaction on a connection that is already in an error state. The rollback issued after a failed statement went through a cursor, so it needed exactly that transaction and failed, and the failure was swallowed. The connection stayed unusable and every later statement raised "INVALID_STATE: [libpq] cannot start transaction". Roll back through the connection instead, falling back to the cursor statement when a driver exposes no connection handle. Uncommitted work in the aborted transaction is discarded, which is what PostgreSQL requires, so the resilience test now commits the rows it expects to outlive the failure.
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.
Summary
Arrow storage streaming now reads one Parquet row group at a time instead of pulling whole objects into memory, and the storage payload codecs reject or mishandle fewer cases. This also cuts the v0.58.0 release.
What changed
stream_arrow_sync()andstream_arrow_async()take a keyword-onlyfile_format="parquet"andbatch_size=65_536, validated before any storage call. Other formats raiseStorageCapabilityError.aclose()on the async iterator, closes the active storage reader.ArrowInvalid: straddling object straddles two block boundaries. The reader block is now sized to the payload.StorageCapabilityErrorrather thanValueError, so callers can catch one SQLSpec error type. A non-positivebatch_sizestays aValueError, since that is an argument error rather than a missing capability.How you use it
Memory is bounded by one Parquet row group, so choose the row-group size when writing the files. Async is the same call with
stream_arrow_async()andasync for.Closes #667.