Repository navigation
fix(bigquery): raise when an Arrow batch arrives before its schema - #18791
Merged
Merged
Conversation
download_arrow_from_job() skipped record batches that arrived before any Arrow schema, in both the inline first page and the ReadRows stream, so rows could go missing without an error. Raise ValueError instead. Normal responses always send the schema first, so this only fires on a malformed response.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Arrow query downloading logic to explicitly raise a ValueError if an Arrow record batch is received before its schema is available, rather than silently ignoring it. It also adds corresponding unit tests to verify this behavior. There are no review comments, so I have no additional feedback to provide.
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.
Raises an error when an Arrow record batch arrives before its schema. Before,
download_arrow_from_job()skipped such batches, so rows could go missing from Arrow query results without any error.The skip has been there since Arrow support was added in #18027, so this fixes it on
mainon its own. #18651 (which reviewers flagged it on) will rebase on top of this.ValueErrorfor a batch without a schema in the inlinejobs.queryfirst page.ValueErrorfor a batch without a schema in theReadRowsstream.