feat: BigQuery Storage v1beta1 API migration guide#14345
Open
benhxy wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a migration guide for transitioning Python code using the BigQuery Storage API from version v1beta1 to v1. The review feedback correctly identifies a critical issue in the guide's text and code examples: the parameter for specifying a stream in read_rows is incorrectly documented as name instead of read_stream, which would cause a runtime TypeError for users following the guide.
Comment on lines
+21
to
+23
| * **Read Rows Request**: `StreamPosition` is flattened. You now pass the | ||
| stream name directly to `read_rows` as `name` (maps to `read_stream` in | ||
| proto) and the `offset`. |
Contributor
Comment on lines
+118
to
+123
| # read_rows accepts stream name and offset directly. | ||
| # Note that the parameter name in the library helper is 'name', which maps to 'read_stream' in proto. | ||
| reader = client.read_rows( | ||
| name=session.streams[0].name, | ||
| offset=0 | ||
| ) |
Contributor
There was a problem hiding this comment.
The keyword argument for specifying the stream in read_rows is read_stream, not name. Passing name will raise a TypeError: read_rows() got an unexpected keyword argument 'name'.
Suggested change
| # read_rows accepts stream name and offset directly. | |
| # Note that the parameter name in the library helper is 'name', which maps to 'read_stream' in proto. | |
| reader = client.read_rows( | |
| name=session.streams[0].name, | |
| offset=0 | |
| ) | |
| # read_rows accepts stream name and offset directly. | |
| reader = client.read_rows( | |
| read_stream=session.streams[0].name, | |
| offset=0 | |
| ) |
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.
Description
Fixes b/505001153. BigQuery Storage team is planning to deprecate v1beta1 API. This PR adds a migration guide from v1beta1 to v1.
Checklist
Testing
Compliance & Style
Post-Approval Actions