-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Updates YAML SDK to replace Kafka read/write transforms with equivalent managed transforms #34755
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'underlying_transform_identifier update_compatibility_version') | |
'underlying_transform_identifier, update_compatibility_version') |
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.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious how this is getting imported from top-level apache_beam
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.
We include everything under the "transforms" package in the top level:
beam/sdks/python/apache_beam/__init__.py
Line 93 in b9fa49a
from apache_beam.transforms import * |
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well simplify and throw an error if identifier is not in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING
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.
Done.
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. PTAL.
|
||
ManagedReplacement = namedtuple( | ||
'ManagedReplacement', | ||
'underlying_transform_identifier update_compatibility_version') |
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.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We include everything under the "transforms" package in the top level:
beam/sdks/python/apache_beam/__init__.py
Line 93 in b9fa49a
from apache_beam.transforms import * |
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
services_and_names = managed._EXPANSION_SERVICE_JAR_TARGETS |
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.
Done.
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.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.