[BEAM-8280] Enable type hint annotations#10717
Merged
udim merged 1 commit intoapache:masterfrom Mar 20, 2020
Merged
Conversation
3018d07 to
cc854f5
Compare
Member
Author
|
Run Portable_Python PreCommit |
Member
Author
|
Run PythonFormatter PreCommit |
Member
Author
|
Run Python PreCommit |
udim
added a commit
to udim/beam
that referenced
this pull request
Feb 19, 2020
Adds `@decorators.no_annotations` decorator to disable on a specific function. Split out of apache#10717
4 tasks
udim
added a commit
that referenced
this pull request
Feb 20, 2020
469319e to
cccd4b6
Compare
Member
Author
|
Run Python PreCommit |
Member
Author
|
Run Python2_PVR_Flink PreCommit |
Member
Author
|
R: @robertwb |
fb3230b to
e8d2844
Compare
Changes default to use type annotations. Adds `apache_beam.typehints.disable_type_annotations()`, which disables annotations globally.
e8d2844 to
636de82
Compare
Member
Author
|
Run Python PreCommit |
1 similar comment
Member
Author
|
Run Python PreCommit |
angoenka
reviewed
Mar 31, 2020
Contributor
angoenka
left a comment
There was a problem hiding this comment.
I was looking into it while triaging failing import.
| _ANY_VAR_KEYWORD = typehints.Dict[typehints.Any, typehints.Any] | ||
| # TODO(BEAM-8280): Remove this when from_callable is ready to be enabled. | ||
| _enable_from_callable = False | ||
| _disable_from_callable = False |
Contributor
There was a problem hiding this comment.
Should this be True? (based on the check in line 234)
Member
Author
There was a problem hiding this comment.
No, I inverted the logic and made using type annotations on by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes default to use type annotations.
Adds a couple of way to disable them:
apache_beam.typehints.disable_type_annotations()to disable globally.@apache_beam.typehints.no_annotationsdecorator to disable on a specificfunction.
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-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.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.