Updates YAML SDK to replace Kafka read/write transforms with equivalent managed transforms#34755
Conversation
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
b2787fd to
98de30b
Compare
|
Assigning reviewers. If you would like to opt out of this review, comment R: @shunping for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
98de30b to
8c91c8c
Compare
|
PreCommit_Yaml_Xlang_Direct seems to be perma-red: #32603 |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
|
|
||
| ManagedReplacement = namedtuple( | ||
| 'ManagedReplacement', | ||
| 'underlying_transform_identifier update_compatibility_version') |
There was a problem hiding this comment.
| 'underlying_transform_identifier update_compatibility_version') | |
| 'underlying_transform_identifier, update_compatibility_version') |
| import apache_beam.dataframe.io | ||
| import apache_beam.io | ||
| import apache_beam.transforms.util | ||
| from apache_beam import ManagedReplacement |
There was a problem hiding this comment.
Curious how this is getting imported from top-level apache_beam
There was a problem hiding this comment.
We include everything under the "transforms" package in the top level:
beam/sdks/python/apache_beam/__init__.py
Line 93 in b9fa49a
|
|
||
| compatibility_version_match = True | ||
| if self._managed_replacement and compatibility_version_match: | ||
| compat_version_match = not is_compat_version_prior_to( |
There was a problem hiding this comment.
can we use a clearer name than compat_version_match? Not sure if this means the SDK version is before or after the specified update_compatibility_version
| if identifier in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING: | ||
| default_target = MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING.get(identifier) |
There was a problem hiding this comment.
Might as well simplify and throw an error if identifier is not in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING
chamikaramj
left a comment
There was a problem hiding this comment.
Thanks. PTAL.
|
|
||
| ManagedReplacement = namedtuple( | ||
| 'ManagedReplacement', | ||
| 'underlying_transform_identifier update_compatibility_version') |
| import apache_beam.dataframe.io | ||
| import apache_beam.io | ||
| import apache_beam.transforms.util | ||
| from apache_beam import ManagedReplacement |
There was a problem hiding this comment.
We include everything under the "transforms" package in the top level:
beam/sdks/python/apache_beam/__init__.py
Line 93 in b9fa49a
|
|
||
| compatibility_version_match = True | ||
| if self._managed_replacement and compatibility_version_match: | ||
| compat_version_match = not is_compat_version_prior_to( |
| if identifier in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING: | ||
| default_target = MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING.get(identifier) |
8373652 to
03fb49c
Compare
|
Failing test: |
| _IO_EXPANSION_SERVICE_JAR_TARGET = "sdks:java:io:expansion-service:shadowJar" | ||
|
|
||
| _GCP_EXPANSION_SERVICE_JAR_TARGET = ( | ||
| "sdks:java:io:google-cloud-platform:expansion-service:shadowJar") |
There was a problem hiding this comment.
Maybe combine these in a list of "supported expansion jar targets" and replace this:
beam/sdks/python/gen_managed_doc.py
Line 102 in 74c514f
6976ce5 to
ae0fe9d
Compare
|
PTAL. |
To preserve update compatibility, we avoid replacement if the an 'updateCompatibilityBeamVersion' with an old Beam version is provided.
This fixes #34767
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.mdwith 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.