-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Support dynamic destinations with Python Storage API #30045
Conversation
Assigning reviewers. If you would like to opt out of this review, comment R: @AnandInguva for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
R: @chamikaramj |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
input_beam_rows = ( | ||
input_rows | ||
| "Wrap in Beam Row" >> | ||
beam.Map(lambda row: beam.Row(destination=row[0], record=row[ |
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.
Is it possible for row[0] or row[1] to be None?
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.
Only if the dynamic destination function returns None, which would be weird from the user's side.
GCP Xlang Postcommit Dataflow run: https://github.com/apache/beam/actions/runs/7603738594/job/20705831041?pr=30045 |
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.
This LGTM
LGTM. |
Python's write to BQ Storage API connector uses the cross-language framework. This PR adds support for dynamic destinations to this write mode.
Destination for each row is determined in the Python side using the callable. Then we send each row with its destination over to Java. We send Java a magic string to communicate that dynamic destinations are being used so that it handles this correctly.