-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: missing first page in to_dataframe #15575
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3b67859
added tests for issue
daniel-sanche 052d9d5
added fix
daniel-sanche 4b53c99
Merge branch 'main' into gemini_14900
daniel-sanche c6960f0
simplified code
daniel-sanche b647174
restructured code
daniel-sanche 0470297
cleaned up code
daniel-sanche 846bac8
fixed comments
daniel-sanche fd23fc3
Update packages/google-cloud-bigquery-storage/google/cloud/bigquery_s…
daniel-sanche 31595bc
raise error if format changes mid-stream
daniel-sanche 7d007af
updated comment
daniel-sanche 7c43864
added word
daniel-sanche ecd6b5e
updated test
daniel-sanche 0a40ae8
clean up code
daniel-sanche 8f5bc28
fixed 3.7 test
daniel-sanche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the current implementation correctly handles the case where the first page fails to convert to Arrow, it is technically susceptible to data loss if
p.to_arrow()succeeds for the first page but fails for a subsequent one (as thepagesiterator would have been partially consumed before theexceptblock is reached). Although BigQuery Storage streams are typically homogeneous in format, it is safer to verify the first page individually before committing to the full iteration.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this code assumes if the first page is in arrow format, the rest of the stream will be as well. @Linchin let me know if that's a wrong assumption
I think I'll change the code to raise an exception if we do get in this unexpected state though, to be explicit about what we expect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's reasonable to expect the following pages to be arrow too. Thanks for adding the exception, just in case.