Skip to content
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

Add explicit error for PEP 585 type hints #24986

Merged
merged 10 commits into from
Jan 18, 2023
Merged

Conversation

jrmccluskey
Copy link
Contributor

@jrmccluskey jrmccluskey commented Jan 12, 2023

Adds an explicit warning for users attempting to use PEP 585 type hints, directing them to use the typing module. Serves as a small improvement to the user experience while support for the new type hinting convention is designed and implemented.

Part of #23366


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: 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, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #24986 (221b9ce) into master (c3a2aac) will increase coverage by 14.44%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           master   #24986       +/-   ##
===========================================
+ Coverage   58.68%   73.12%   +14.44%     
===========================================
  Files         735      735               
  Lines       98146    98150        +4     
===========================================
+ Hits        57594    71771    +14177     
+ Misses      39188    25015    -14173     
  Partials     1364     1364               
Flag Coverage Δ
python 82.67% <50.00%> (+20.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/python/apache_beam/typehints/typehints.py 92.88% <50.00%> (-0.17%) ⬇️
sdks/python/apache_beam/typehints/opcodes.py 85.35% <0.00%> (+0.35%) ⬆️
sdks/python/apache_beam/io/gcp/pubsub.py 90.78% <0.00%> (+0.43%) ⬆️
sdks/python/apache_beam/io/textio.py 97.05% <0.00%> (+0.73%) ⬆️
...n/apache_beam/runners/direct/evaluation_context.py 91.83% <0.00%> (+1.02%) ⬆️
sdks/python/apache_beam/utils/timestamp.py 96.84% <0.00%> (+1.05%) ⬆️
...dks/python/apache_beam/options/pipeline_options.py 93.97% <0.00%> (+1.10%) ⬆️
sdks/python/apache_beam/coders/coder_impl.py 93.77% <0.00%> (+1.11%) ⬆️
sdks/python/apache_beam/testing/test_stream.py 91.02% <0.00%> (+1.28%) ⬆️
sdks/python/apache_beam/typehints/row_type.py 100.00% <0.00%> (+1.31%) ⬆️
... and 222 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jrmccluskey
Copy link
Contributor Author

Run PythonDocs PreCommit

@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @damccorm for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@jrmccluskey jrmccluskey changed the title Add explicit warning for PEP 585 type hints Add explicit error for PEP 585 type hints Jan 12, 2023
@jrmccluskey
Copy link
Contributor Author

Run Python PreCommit

@jrmccluskey
Copy link
Contributor Author

Run PythonDocs PreCommit

@jrmccluskey
Copy link
Contributor Author

Run Python_Runners PreCommit

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had one comment

sdks/python/apache_beam/typehints/typehints.py Outdated Show resolved Hide resolved
Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrmccluskey
Copy link
Contributor Author

Run Python_Runners PreCommit

@jrmccluskey jrmccluskey merged commit 55d8ecb into apache:master Jan 18, 2023
@jrmccluskey jrmccluskey deleted the typeWarn branch January 18, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants