Skip to content

Handle types.GenericAlias types properly during validation#27633

Merged
tvalentyn merged 5 commits intoapache:masterfrom
jrmccluskey:genericSoda
Jul 25, 2023
Merged

Handle types.GenericAlias types properly during validation#27633
tvalentyn merged 5 commits intoapache:masterfrom
jrmccluskey:genericSoda

Conversation

@jrmccluskey
Copy link
Copy Markdown
Contributor

A bug was found by a user jumping from Python 3.10 to Python 3.11 failing a parameterized generic type check improperly. The root cause seems to be a lack of support for the PEP-585 types.GenericAlias class, which was not being treated as a typing generic by the type hinting code. This corrects that issue and adds a unit test case that reproduced the original issue.


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
Copy Markdown

codecov bot commented Jul 24, 2023

Codecov Report

Merging #27633 (2476e71) into master (8afaa65) will decrease coverage by 0.16%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master   #27633      +/-   ##
==========================================
- Coverage   71.10%   70.94%   -0.16%     
==========================================
  Files         859      861       +2     
  Lines      104544   104795     +251     
==========================================
+ Hits        74335    74346      +11     
- Misses      28652    28892     +240     
  Partials     1557     1557              
Flag Coverage Δ
python 80.01% <66.66%> (-0.28%) ⬇️

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

Files Changed Coverage Δ
sdks/python/apache_beam/typehints/typehints.py 93.09% <66.66%> (ø)

... and 14 files with indirect coverage changes

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

@github-actions
Copy link
Copy Markdown
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
Copy link
Copy Markdown
Contributor Author

@tvalentyn PTAL at the small changes

@tvalentyn
Copy link
Copy Markdown
Contributor

codecov fails b/c it runs on Python 3.8, we should be good w/ test coverage.

@tvalentyn tvalentyn merged commit d147ea1 into apache:master Jul 25, 2023
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