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
[BEAM-12145] Normalize and size-limit transform Ids #14500
[BEAM-12145] Normalize and size-limit transform Ids #14500
Conversation
Run Java PostCommit |
3d29f9e
to
31ffe77
Compare
@@ -191,6 +193,10 @@ private String getApplicationName(AppliedPTransform<?, ?, ?> appliedPTransform) | |||
if (name.isEmpty()) { | |||
name = "unnamed-ptransform"; | |||
} | |||
// Normalize, trim, and uniqify. | |||
int maxNameLength = 100; | |||
name = Normalizer.normalize(name, Form.NFC).replaceAll("[^A-Za-z0-9-_]", "-"); |
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.
Let's document the required regex in the pipeline proto. Is there validation logic like there is in Python? That would be a good place to check it, too.
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.
Added a comment to the proto recommending alphanumeric characters, '_', and '-' for transform IDs.
Also added a test.
Corresponding Python changes are in #14502.
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.
LGTM but also let's make sure this is part of spec before merging.
31ffe77
to
f693052
Compare
2d0b60c
to
bee1a14
Compare
Run Python PreCommit |
Run Java_Examples_Dataflow PreCommit |
Run Java PostCommit |
bee1a14
to
30afbcb
Compare
Run Java PostCommit |
Run Python PreCommit |
Transform IDs generated by the SDK may be used by runners to identify pipeline steps hence its preferable to keep them normalized, size limited, and unique.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.