-
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
[yaml] Add use cases for Enrichment transform in YAML #32289
base: master
Are you sure you want to change the base?
Conversation
Assigning reviewers. If you would like to opt out of this review, comment R: @damccorm for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
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.
Thanks! Added a few comments
sdks/python/apache_beam/yaml/examples/enrich_spanner_with_bigquery.yaml
Outdated
Show resolved
Hide resolved
options: | ||
project_id: "apache-beam-testing" |
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 this necessary? It is defined in all the transforms, so not sure why it would be required
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.
Just a couple small changes, thanks!
Reminder, please take a look at this pr: @damccorm @ahmedabu98 |
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @liferoad for label python. Available commands:
|
Reminder, please take a look at this pr: @liferoad @johnjcasey |
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @tvalentyn for label python. Available commands:
|
@Polber what are next steps on this PR? @reeba212 it looks like some precommit checks are failing - would you mind taking a look? At a glance, I see:
|
End to end use case that demonstrates how spanner IO and enrichment transform coupled with other YAML transforms can be used in the real world
763f76a
to
844d9de
Compare
You should be able to rebase on master now and pull in the EnrichmentTransform changes |
Reminder, please take a look at this pr: @tvalentyn @Abacn |
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment R: @damccorm for label python. Available commands:
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
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 left a couple comments that should help turn tests green.
This will require rebasing on #33027 once it is merged
# Expected: | ||
# Row(sale_id = 1, customer_id = 1, product_id = 1, quantity = 1, product = Row(product_id: "1", product_name = "pixel 5", product_stock = "2")) |
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.
- Add options block with experimental feature
- Unindent the Expected block
- Fix the formatting of the expected element (copy the below exactly)
# Expected: | |
# Row(sale_id = 1, customer_id = 1, product_id = 1, quantity = 1, product = Row(product_id: "1", product_name = "pixel 5", product_stock = "2")) | |
options: | |
yaml_experimental_features: Enrichment | |
# Expected: | |
# Row(sale_id=1, customer_id=1, product_id=1, quantity=1, product={'product_id': '1', 'product_name': 'pixel 5', 'product_stock': '2'}) |
['test_simple_filter_yaml', 'test_simple_filter_and_combine_yaml']) | ||
['test_simple_filter_yaml', 'test_simple_filter_and_combine_yaml', 'test_spanner_read_yaml', 'test_spanner_write_yaml']) |
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.
- There is a similar method above this one called
_file_io_write_test_preprocessor
. You need to add the following to the list in the@YamlExamplesTestSuite.register_test_preprocessor
annotationtest_bigtable_enrichment_yaml
test_enrich_spanner_with_bigquery_yaml
Should look very similar to the change on line 159 above
input: WriteProcessedOrders.my_error_output | ||
config: | ||
path: 'errors.json' | ||
|
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.
Add Expected block:
# Expected: | |
# Row(customer_id=1001, customer_name='Alice', customer_email='[email protected]', product_id=2001, order_date='24-03-24', order_amount=150) | |
# Row(customer_id=1003, customer_name='Claire', customer_email='[email protected]', product_id=2003, order_date='7-05-24', order_amount=110) |
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.