-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Per element schema parsing in ConvertToBeamRows #36393
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2764,6 +2764,9 @@ def expand(self, input): | |
|
|
||
| class ConvertToBeamRows(PTransform): | ||
| def __init__(self, schema, dynamic_destinations): | ||
| if not isinstance(schema, | ||
| (bigquery.TableSchema, bigquery.TableFieldSchema)): | ||
| schema = bigquery_tools.get_bq_tableschema(schema) | ||
|
Comment on lines
+2767
to
+2769
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good optimization to parse the schema once at transform construction. This change makes the schema parsing logic inside
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good bot |
||
| self.schema = schema | ||
| self.dynamic_destinations = dynamic_destinations | ||
|
|
||
|
|
||
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.
do we need remove the lines in beam_row_from_dict?
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.
or
beam_row_from_dictis used elsewhere, so we should keep it. Just a thought.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 could remove it but
beam_row_from_dict is publicly used method so removing this if would be potentially breaking change.