-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix naming for NewType and NamedTuple #3
Conversation
R: @AnandInguva |
# Special case for NewType, where, since Python 3.10, NewType is now a class | ||
# rather than a function. | ||
# TODO(https://github.com/apache/beam/issues/20076): Currently unhandled. | ||
_LOGGER.info('Converting NewType type hint to Any: "%s"', typ) |
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.
Makes sense. Before this change in Python 3.10,
if NewType('Number', int)
was passed, then the type would be apache_beam.typehints.native_type_compatibility_test.Number
instead of Any
right?. With this change, it would become Any
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.
Correct.
We still need to handle it fully in apache#20076, but that can be done outside of this 3.10 PR.
* Update Pytest version to support Python 3.10 * Update pytest-cov * update dependencies with updated pytest related changes * set upToDateWhen = false * add 3.10 to tox and pytest * Change float to string for python versions * Add python 3.10 container update python 3.10 dependencies * Add precommit and postcommit changes apache#21971 * Add Python 3.10 build file to the test suites * Update tox with python 3.10 and add python 3.10 test suites to settings.gradle.kts * Add InferencePostCommit to Py310 from Py39 * Change jump offset multiplier * Add GEN_START * Update comment * add tox test suite * Fix NewType and NamedTuple (#3) * Remove unified repr (#4) * Fix NewType and NamedTuple * Fix names in unit tests * Remove commented out code (#5) * Fix more failing tests (#6) * Remove commented out code * Fix other tests * fixup assertion * resolve merge conflicts * Add Python 3.10 to Dataflow supported version. Sickbay runner v1 tests * Remove Python 3.10 warning * Fixup test * Enable additional Dataflow test suites * Update dependencies * Add Python 3.10 to GH actions tests * Add Python 3.10 to some dataflow test-suites * Unskip tests that were sickbayed for runner_v1 * Update pandas dep for Python 3.10 * Fixup: typo * generate dependencies * pin protobuf requirement * pin grpcio version * Revert "pin grpcio version" This reverts commit 82f9bbb. * Revert "pin protobuf requirement" This reverts commit 00e5b98. * install protobuf from source * Revert "install protobuf from source" This reverts commit 2aa434a. * Pin Protobuf to 3.19.4 Co-authored-by: Anand Inguva <anandinguva@google.com> Co-authored-by: Andy Ye <andyye333@gmail.com>
This reverts commit 7e870b4.
A few unit tests were failing.
In Python 3.10,
NewType
is now a class rather than a function. See details here.Also going to start use
repr
for Python 3.10. New PR to address that issue (apache#20982) is coming soon.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.
ValidatesRunner
compliance status (on master branch)Examples testing status on various runners
Post-Commit SDK/Transform Integration 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.