-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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-5321] Port transforms package to Python 3 #7104
Conversation
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.
How many tests are affected by dill bug? I think we can skip them if they are small amount of number in order to enable the rest early.
if sys.version_info[0] >= 3: | ||
expected_msg = \ | ||
"Type hint violation for 'CombinePerKey(MeanCombineFn)': " \ | ||
"requires Tuple[TypeVariable[K], Union[float, int]] " \ |
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.
Why long
is missing here in Python 3? A comment may help people understand the branching here.
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.
In Python 3, short integers are gone and long
has become int
.
The tests fail on importing window_test.py on this line. |
sgtm |
Let's try to find out when dill could make a release with the fix. It's possible to monkey-patch dill, but it may be brittle. |
The PR on dill has already been merged. I've asked when we can expect this to be released. |
pip-installing the commit sounds good to me as long as we version-guard that for Python3 only, and track the cleanup in Jira. |
3c05319
to
fd2d713
Compare
sdks/python/setup.py
Outdated
] | ||
|
||
REQUIRED_PACKAGES_PY3_ONLY = [ | ||
'avro-python3>=1.8.1,<2.0.0' | ||
'avro-python3>=1.8.1,<2.0.0', | ||
'git+git://github.com/uqfoundation/dill.git' |
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.
Could you add a comment here with a todo link to JIRA.
88d2dbe
to
403a723
Compare
] | ||
|
||
REQUIRED_PACKAGES_PY3_ONLY = [ | ||
'avro-python3>=1.8.1,<2.0.0' | ||
'avro-python3>=1.8.1,<2.0.0', |
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.
We can simplify requirements spec with python_version
qualifier: See example at:
avro-python3==1.8.2;python_version>="3.4" |
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.
This doesn't seem to work for the dill requirement. We can clean this up when we clean up the dill dependency.
Hi, @RobbeSneyders, what's the status of this PR? |
Hi @tvalentyn, sorry for the wait. |
403a723
to
01b7599
Compare
Seems like adding Line 44 in 01b7599
|
PTAL |
LGTM |
This is is part of a series of PRs with goal to make Apache Beam PY3 compatible. The proposal with the outlined approach has been documented here: https://s.apache.org/beam-python-3.
This PR ports the transforms package.
The test suite currently still fails due to an error in the dill package. By fixing this error in dill itself, the test suite completes successfully. I have submitted a PR to the dill project, however the project does not seem to be very actively maintained.
Is there another way to add this fix to beam?
R: @tvalentyn @markflyhigh @robertwb
Post-Commit Tests Status (on master branch)