[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121537=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121537 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 18:45 Start Date: 10/Jul/18 18:45 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403926630 Thanks all! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121537) Time Spent: 14h 20m (was: 14h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 14h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121535=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121535 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 18:39 Start Date: 10/Jul/18 18:39 Worklog Time Spent: 10m Work Description: charlesccychen closed pull request #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/sdks/python/apache_beam/transforms/window.py b/sdks/python/apache_beam/transforms/window.py index a67e2cf1b50..5bc047b48c7 100644 --- a/sdks/python/apache_beam/transforms/window.py +++ b/sdks/python/apache_beam/transforms/window.py @@ -53,6 +53,7 @@ from google.protobuf import duration_pb2 from google.protobuf import timestamp_pb2 +from past.builtins import cmp from apache_beam.coders import coders from apache_beam.portability import common_urns diff --git a/sdks/python/scripts/run_mini_py3lint.sh b/sdks/python/scripts/run_mini_py3lint.sh index 63e71771d73..0729c7ba2cf 100755 --- a/sdks/python/scripts/run_mini_py3lint.sh +++ b/sdks/python/scripts/run_mini_py3lint.sh @@ -48,5 +48,4 @@ if test $# -gt 0; then fi echo "Running flake8 for module $MODULE:" -# TODO(BEAM-3959): Add F821 (undefined names) as soon as that test passes -flake8 $MODULE --count --select=E9,F822,F823 --show-source --statistics +flake8 $MODULE --count --select=E9,F821,F822,F823 --show-source --statistics This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121535) Time Spent: 14h 10m (was: 14h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 14h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121534=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121534 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 18:38 Start Date: 10/Jul/18 18:38 Worklog Time Spent: 10m Work Description: charlesccychen commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403924594 This looks fine, and the ValidatesRunner tests pass, so I'm going to merge even though Jenkins seems to buggy right now for the PostSubmit run. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121534) Time Spent: 14h (was: 13h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 14h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121528=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121528 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 18:30 Start Date: 10/Jul/18 18:30 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403922095 I am even more confused. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121528) Time Spent: 13h 50m (was: 13h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 13h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121478=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121478 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 16:46 Start Date: 10/Jul/18 16:46 Worklog Time Spent: 10m Work Description: charlesccychen commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403890413 Run Python Dataflow ValidatesRunner This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121478) Time Spent: 13h 40m (was: 13.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 13h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121474=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121474 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 16:37 Start Date: 10/Jul/18 16:37 Worklog Time Spent: 10m Work Description: charlesccychen commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403887557 Run Python SDK PostCommit This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121474) Time Spent: 13.5h (was: 13h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 13.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121473=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121473 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 16:36 Start Date: 10/Jul/18 16:36 Worklog Time Spent: 10m Work Description: charlesccychen commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403887504 Strange, looks like it crashed / timed out in the middle. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121473) Time Spent: 13h 20m (was: 13h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 13h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121470=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121470 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 16:32 Start Date: 10/Jul/18 16:32 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403886179 Can someone please help me to decipher what went wrong? * https://builds.apache.org/job/beam_PostCommit_Python_Verify_PR/23/ This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121470) Time Spent: 13h 10m (was: 13h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 13h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121267=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121267 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 07:37 Start Date: 10/Jul/18 07:37 Worklog Time Spent: 10m Work Description: charlesccychen commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403729831 Thanks! This LGTM. Will merge once tests pass. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121267) Time Spent: 13h (was: 12h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 13h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121266=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121266 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 07:35 Start Date: 10/Jul/18 07:35 Worklog Time Spent: 10m Work Description: charlesccychen commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403729506 Run Python PostCommit This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121266) Time Spent: 12h 50m (was: 12h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 12h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=121240=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-121240 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 10/Jul/18 06:02 Start Date: 10/Jul/18 06:02 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-403710156 @charlesccychen Your review please? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 121240) Time Spent: 12h 40m (was: 12.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 12h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118589=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118589 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Jul/18 06:05 Start Date: 03/Jul/18 06:05 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-402023132 OK. Can you please create a new PR that solves the problem and when it is checked in then I will gladly close this one. I have zero pride of ownership on these fixes... I merely want them resolved. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118589) Time Spent: 12.5h (was: 12h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 12.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118585=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118585 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Jul/18 05:57 Start Date: 03/Jul/18 05:57 Worklog Time Spent: 10m Work Description: superbobry commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-402021833 > There are no Jenkins build issues using my approach ;-) No, but your approach introduces boilerplate. I think this is worth fixing given that a) there seem to be no issue with importing from `past` on Cython, and b) a `past` import is no less safe than try-except `NameError`. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118585) Time Spent: 12h 20m (was: 12h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 12h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118510=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118510 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Jul/18 00:40 Start Date: 03/Jul/18 00:40 Worklog Time Spent: 10m Work Description: holdenk commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401978352 Ah ok, sorry for my confusion then :) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118510) Time Spent: 12h 10m (was: 12h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 12h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118496=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118496 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:58 Start Date: 02/Jul/18 23:58 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401972217 Yes. The commits were squashed into a single commit. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118496) Time Spent: 12h (was: 11h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 12h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118490=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118490 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:46 Start Date: 02/Jul/18 23:46 Worklog Time Spent: 10m Work Description: pabloem commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401970262 The build ran once more after d9d8689 was pushed. See: https://builds.apache.org/job/beam_PreCommit_Python_Commit/199/ This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118490) Time Spent: 11h 50m (was: 11h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 11h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118489=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118489 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:43 Start Date: 02/Jul/18 23:43 Worklog Time Spent: 10m Work Description: holdenk commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401969902 Isn't https://builds.apache.org/job/beam_PreCommit_Python_Commit/166/console from your approach or am I looking at the wrong build logs? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118489) Time Spent: 11h 40m (was: 11.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 11h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118488=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118488 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:35 Start Date: 02/Jul/18 23:35 Worklog Time Spent: 10m Work Description: cclauss edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401968502 There are no Jenkins build issues using my approach ;-) Besides, I think you already put futurize in all appropriate places in tox.ini This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118488) Time Spent: 11.5h (was: 11h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 11.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118487=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118487 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:34 Start Date: 02/Jul/18 23:34 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401968502 There are no Jenkins build issues using my approach ;-) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118487) Time Spent: 11h 20m (was: 11h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 11h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118486=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118486 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:25 Start Date: 02/Jul/18 23:25 Worklog Time Spent: 10m Work Description: holdenk commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401966969 No, I'm not suggesting you change your approach I'm talking about addressing the jenkins build issues? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118486) Time Spent: 11h 10m (was: 11h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 11h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118484=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118484 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:20 Start Date: 02/Jul/18 23:20 Worklog Time Spent: 10m Work Description: cclauss edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401965759 The current approach is safer... Only redefine __cmp()__ when it is necessary. We only have [18 more months](https://pythonclock.org) to get this done. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118484) Time Spent: 11h (was: 10h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 11h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118483=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118483 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:18 Start Date: 02/Jul/18 23:18 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401965759 The current approach is safer... We only have [18 more months](https://pythonclock.org) to get this done. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118483) Time Spent: 10h 50m (was: 10h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 10h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118479=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118479 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:13 Start Date: 02/Jul/18 23:13 Worklog Time Spent: 10m Work Description: holdenk commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401964936 You could try updating tox.ini to explicitly mention that as a dep? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118479) Time Spent: 10h 40m (was: 10.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 10h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118477=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118477 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:08 Start Date: 02/Jul/18 23:08 Worklog Time Spent: 10m Work Description: superbobry edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401963701 I'm curious, why does Cython fail on Jenkins? I've tried locally with both Python 2.7 and 3.6 and Cython 0.28.1, and the following imports fine: ```python from past.builtins import unicode print(unicode) ``` Could it be that `py27-cython` does not install `future` which is needed for the import to work? What do you think @pabloem? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118477) Time Spent: 10.5h (was: 10h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 10.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118476=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118476 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:08 Start Date: 02/Jul/18 23:08 Worklog Time Spent: 10m Work Description: superbobry edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401963701 I'm curious, why does Cython fail on Jenkins? I've tried locally with both Python 2.7 and 3.6 and Cython 0.28.1, and the following imports fine: ```python from past.builtins import unicode print(unicode) ``` Could it be that `py27-cython` does not install `future` which is needed for the import to work? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118476) Time Spent: 10h 20m (was: 10h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 10h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118475=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118475 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:07 Start Date: 02/Jul/18 23:07 Worklog Time Spent: 10m Work Description: superbobry edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401963701 I'm curious, why does Cython fail on Jenkins? I've tried locally with both Python 2.7 and 3.6 and Cython 0.28.1, and the following imports fine: ```python from past.builtins import unicode print(unicode) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118475) Time Spent: 10h 10m (was: 10h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 10h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118474=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118474 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:06 Start Date: 02/Jul/18 23:06 Worklog Time Spent: 10m Work Description: superbobry edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401963701 I'm curious, why does Cython fail specifically on Python 2.7? I've tried locally with Python 3.6 and 0.28.1, and the following imports fine: ```python from past.builtins import unicode print(unicode) ``` On 2.7 however it produces: ``` ImportError: No module named past.builtins ``` Do you have a theory @pabloem? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118474) Time Spent: 10h (was: 9h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 10h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118473=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118473 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 23:06 Start Date: 02/Jul/18 23:06 Worklog Time Spent: 10m Work Description: superbobry commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401963701 I'm curious, why does Cython fail specifically on Python 2.7? I've tried locally with Python 3.6 and 0.28.1, and the following imports fine: ```python from past.builtins import unicode print(unicode) ``` On 2.7 however it produces: ``` ImportError: No module named past.builtins ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118473) Time Spent: 9h 50m (was: 9h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 9h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118327=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118327 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 18:10 Start Date: 02/Jul/18 18:10 Worklog Time Spent: 10m Work Description: pabloem commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401888505 You can run this test locally via `tox -e py27-cython` from within `sdks/python/` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118327) Time Spent: 9h 40m (was: 9.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 9h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=118326=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118326 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Jul/18 18:10 Start Date: 02/Jul/18 18:10 Worklog Time Spent: 10m Work Description: pabloem commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401888418 It seems that there were failures in Cython: https://builds.apache.org/job/beam_PreCommit_Python_Commit/166/console This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 118326) Time Spent: 9.5h (was: 9h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 9.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117917=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117917 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 21:29 Start Date: 30/Jun/18 21:29 Worklog Time Spent: 10m Work Description: cclauss commented on a change in pull request #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#discussion_r199332628 ## File path: sdks/python/apache_beam/io/gcp/datastore/v1/helper.py ## @@ -49,6 +49,12 @@ # pylint: enable=ungrouped-imports +try: Review comment: @superbobry A perfect suggestion. Thanks much. Done. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117917) Time Spent: 9h 20m (was: 9h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 9h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117914=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117914 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 21:17 Start Date: 30/Jun/18 21:17 Worklog Time Spent: 10m Work Description: superbobry commented on a change in pull request #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#discussion_r199332439 ## File path: sdks/python/apache_beam/io/gcp/datastore/v1/helper.py ## @@ -49,6 +49,12 @@ # pylint: enable=ungrouped-imports +try: Review comment: This one-liner has the same effect: ```python from past.bulitins import cmp `` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117914) Time Spent: 9h (was: 8h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 9h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117915=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117915 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 21:17 Start Date: 30/Jun/18 21:17 Worklog Time Spent: 10m Work Description: superbobry commented on a change in pull request #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#discussion_r199332439 ## File path: sdks/python/apache_beam/io/gcp/datastore/v1/helper.py ## @@ -49,6 +49,12 @@ # pylint: enable=ungrouped-imports +try: Review comment: This one-liner has the same effect: ```python from past.bulitins import cmp ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117915) Time Spent: 9h 10m (was: 9h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 9h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117870=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117870 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 15:47 Start Date: 30/Jun/18 15:47 Worklog Time Spent: 10m Work Description: cclauss edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401548830 Agreed. When I thought about centralizing it but the three files are not near each other in the hierarchy (io, testing, transforms) but I suppose we could do something like __from apache_beam.utils.compat import cmp__ It also stuck me as a bit weird (in legacy Python) to import a _builtin_ from another file so that made the try/except block essential which in turn means that just _one line per file_ is actually saved. I will make the change if that seems like the best approach. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117870) Time Spent: 8h 50m (was: 8h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 8h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117869=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117869 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 15:46 Start Date: 30/Jun/18 15:46 Worklog Time Spent: 10m Work Description: cclauss edited a comment on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401548830 Agreed. When I thought about centralizing it but the three files are not near each other in the hierarchy (io, testing, transforms) but I suppose we could do something like __from apache_beam.utils.compat import cmp__ It also stuck me as a bit weird (in legacy Python) to import a _builtin_ from another file so that made the try/except block essential which then means that one _one line per file_ is actually saved. I will make the change if that seems like the best approach. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117869) Time Spent: 8h 40m (was: 8.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 8h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117868=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117868 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 15:45 Start Date: 30/Jun/18 15:45 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401548830 Agreed. When I thought about centralizing it but the three files are not near each other in the hierarchy (io, testing, transforms) but I suppose we could do something like __from from apache_beam.utils.compat import cmp__ It also stuck me as a bit weird (in legacy Python) to import a _builtin_ from another file so that made the try/except block essential which then means that one _one line per file_ is actually saved. I will make the change if that seems like the best approach. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117868) Time Spent: 8.5h (was: 8h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 8.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117855=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117855 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 15:00 Start Date: 30/Jun/18 15:00 Worklog Time Spent: 10m Work Description: holdenk commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401546350 So I’d still rather remove them long term, but I agree in the short term hopefully this is easier to get a committer to sign off on. That being said having 3 copies of the function isn’t great, how about moving it somewhere common? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117855) Time Spent: 8h 20m (was: 8h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 8h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117805=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117805 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 08:33 Start Date: 30/Jun/18 08:33 Worklog Time Spent: 10m Work Description: cclauss commented on issue #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843#issuecomment-401526929 @aaltay @holdenk This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 117805) Time Spent: 8h 10m (was: 8h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 8h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117804=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-117804 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 30/Jun/18 08:32 Start Date: 30/Jun/18 08:32 Worklog Time Spent: 10m Work Description: cclauss opened a new pull request #5843: [BEAM-3761] Define cmp() in Python 3 URL: https://github.com/apache/beam/pull/5843 Signed-off-by: cclauss **Please** add a meaningful description for your change here Define __cmp()__ function that was removed in Python 3. A more straight ahead approach to #4774 that should be easier to review. Fixes the following issues: flake8 testing of https://github.com/apache/beam on Python 3.6.3 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./sdks/python/apache_beam/io/vcfio_test.py:77:14: F821 undefined name 'cmp' return cmp(v1.end, v2.end) ^ ./sdks/python/apache_beam/io/vcfio_test.py:78:12: F821 undefined name 'cmp' return cmp(v1.start, v2.start) ^ ./sdks/python/apache_beam/io/vcfio_test.py:79:10: F821 undefined name 'cmp' return cmp(v1.reference_name, v2.reference_name) ^ ./sdks/python/apache_beam/io/gcp/datastore/v1/helper.py:93:12: F821 undefined name 'cmp' result = cmp(p1.kind, p2.kind) ^ ./sdks/python/apache_beam/io/gcp/datastore/v1/helper.py:101:12: F821 undefined name 'cmp' return cmp(p1.id, p2.id) ^ ./sdks/python/apache_beam/io/gcp/datastore/v1/helper.py:106:10: F821 undefined name 'cmp' return cmp(p1.name, p2.name) ^ ./sdks/python/apache_beam/transforms/window.py:195:12: F821 undefined name 'cmp' return cmp(self.end, other.end) or cmp(hash(self), hash(other)) ^ ./sdks/python/apache_beam/transforms/window.py:195:40: F821 undefined name 'cmp' return cmp(self.end, other.end) or cmp(hash(self), hash(other)) ^ ./sdks/python/apache_beam/transforms/window.py:250:14: F821 undefined name 'cmp' return cmp(type(self), type(other)) ^ ./sdks/python/apache_beam/transforms/window.py:251:12: F821 undefined name 'cmp' return cmp((self.value, self.timestamp), (other.value, other.timestamp)) ^ ``` Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). It will help us expedite review of your Pull Request if you tag someone (e.g. `@username`) to look at it. Post-Commit Tests Status (on master branch) Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark --- | --- | --- | --- | --- | --- | --- | --- Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/) | --- | --- | --- | --- | --- | --- Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/) | [![Build
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=111768=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-111768 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 14/Jun/18 04:54 Start Date: 14/Jun/18 04:54 Worklog Time Spent: 10m Work Description: stale[bot] commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-397170047 This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 111768) Time Spent: 7h 40m (was: 7.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 7h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=111773=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-111773 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 14/Jun/18 04:56 Start Date: 14/Jun/18 04:56 Worklog Time Spent: 10m Work Description: stale[bot] closed pull request #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/sdks/python/apache_beam/io/gcp/datastore/v1/helper.py b/sdks/python/apache_beam/io/gcp/datastore/v1/helper.py index 87d798bebe3..7a58fe3e212 100644 --- a/sdks/python/apache_beam/io/gcp/datastore/v1/helper.py +++ b/sdks/python/apache_beam/io/gcp/datastore/v1/helper.py @@ -90,7 +90,7 @@ def compare_path(p1, p2): 3. If no `id` is defined for both paths, then their `names` are compared. """ - result = cmp(p1.kind, p2.kind) + result = (p1.kind > p2.kind) - (p1.kind < p2.kind) if result != 0: return result @@ -98,12 +98,12 @@ def compare_path(p1, p2): if not p2.HasField('id'): return -1 -return cmp(p1.id, p2.id) +return (p1.id > p2.id) - (p1.id < p2.id) if p2.HasField('id'): return 1 - return cmp(p1.name, p2.name) + return (p1.name > p2.name) - (p1.name < p2.name) def get_datastore(project): diff --git a/sdks/python/apache_beam/io/vcfio_test.py b/sdks/python/apache_beam/io/vcfio_test.py index 029515fe341..a750dc74711 100644 --- a/sdks/python/apache_beam/io/vcfio_test.py +++ b/sdks/python/apache_beam/io/vcfio_test.py @@ -70,15 +70,6 @@ def get_full_dir(): return os.path.join(os.path.dirname(__file__), '..', 'testing', 'data', 'vcf') -# Helper method for comparing variants. -def _variant_comparator(v1, v2): - if v1.reference_name == v2.reference_name: -if v1.start == v2.start: - return cmp(v1.end, v2.end) -return cmp(v1.start, v2.start) - return cmp(v1.reference_name, v2.reference_name) - - # Helper method for verifying equal count on PCollection. def _count_equals_to(expected_count): def _count_equal(actual_list): diff --git a/sdks/python/apache_beam/testing/test_stream.py b/sdks/python/apache_beam/testing/test_stream.py index 8a63e7bd056..db4cc66b1d0 100644 --- a/sdks/python/apache_beam/testing/test_stream.py +++ b/sdks/python/apache_beam/testing/test_stream.py @@ -21,7 +21,7 @@ """ from abc import ABCMeta -from abc import abstractmethod +from functools import total_ordering from apache_beam import coders from apache_beam import core @@ -46,44 +46,65 @@ class Event(object): __metaclass__ = ABCMeta - def __cmp__(self, other): -if type(self) is not type(other): - return cmp(type(self), type(other)) -return self._typed_cmp(other) - - @abstractmethod - def _typed_cmp(self, other): -raise NotImplementedError - +@total_ordering class ElementEvent(Event): """Element-producing test stream event.""" def __init__(self, timestamped_values): self.timestamped_values = timestamped_values - def _typed_cmp(self, other): -return cmp(self.timestamped_values, other.timestamped_values) + def __eq__(self, other): +return (type(self) is type(other) and +self.timestamped_values == other.timestamped_values) + + def __ne__(self, other): +return not self.__eq__(other) + + def __lt__(self, other): +if type(self) is not type(other): + return type(self) < type(other) +return self.timestamped_values < other.timestamped_values +@total_ordering class WatermarkEvent(Event): """Watermark-advancing test stream event.""" def __init__(self, new_watermark): self.new_watermark = timestamp.Timestamp.of(new_watermark) - def _typed_cmp(self, other): -return cmp(self.new_watermark, other.new_watermark) + def __eq__(self, other): +return (type(self) is type(other) and +self.new_watermark == other.new_watermark) + def __ne__(self, other): +return not self.__eq__(other) + def __lt__(self, other): +if type(self) is not type(other): + return type(self) < type(other) +return self.new_watermark < other.new_watermark + + +@total_ordering class ProcessingTimeEvent(Event): """Processing time-advancing test stream event.""" def __init__(self, advance_by): self.advance_by = timestamp.Duration.of(advance_by) - def _typed_cmp(self, other): -return cmp(self.advance_by, other.advance_by) + def __eq__(self, other): +return (type(self) is type(other) and +self.advance_by == other.advance_by) + + def __ne__(self, other): +return not self.__eq__(other) + + def
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=109611=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-109611 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 07/Jun/18 04:01 Start Date: 07/Jun/18 04:01 Worklog Time Spent: 10m Work Description: stale[bot] commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-395285646 This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the d...@beam.apache.org list. Thank you for your contributions. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 109611) Time Spent: 7.5h (was: 7h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 7.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=87406=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-87406 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 04/Apr/18 02:43 Start Date: 04/Apr/18 02:43 Worklog Time Spent: 10m Work Description: cgarciae commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-378462493 Also getting this error :( I am reverting to python 2 for this but hope it gets fixed soon. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 87406) Time Spent: 7h 20m (was: 7h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 7h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=87159=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-87159 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Apr/18 16:45 Start Date: 03/Apr/18 16:45 Worklog Time Spent: 10m Work Description: aaltay commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-378317211 @cclauss perhaps it is a flake with installation? 0.26.1 is also available on pypi even though it is not the latest version. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 87159) Time Spent: 7h 10m (was: 7h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 7h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=86993=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-86993 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Apr/18 08:17 Start Date: 03/Apr/18 08:17 Worklog Time Spent: 10m Work Description: cclauss commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-378167595 There seems to be a failure installing cython==0.26.1... The current cython on PyPI is 0.28.1 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 86993) Time Spent: 7h (was: 6h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 7h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=86992=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-86992 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Apr/18 08:17 Start Date: 03/Apr/18 08:17 Worklog Time Spent: 10m Work Description: cclauss commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-378167595 There seems to be a failure installing cython==0.26.1... The current cython on PyPI is 0.2__8__.1 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 86992) Time Spent: 6h 50m (was: 6h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 6h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=86946=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-86946 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 03/Apr/18 05:17 Start Date: 03/Apr/18 05:17 Worklog Time Spent: 10m Work Description: aaltay commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-378130998 @holdenk do you know why tests are failing before we merge? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 86946) Time Spent: 6h 40m (was: 6.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 6h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=86748=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-86748 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 02/Apr/18 20:17 Start Date: 02/Apr/18 20:17 Worklog Time Spent: 10m Work Description: holdenk commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-378031436 CC @aaltay This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 86748) Time Spent: 6.5h (was: 6h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 6.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=81008=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-81008 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 15/Mar/18 22:57 Start Date: 15/Mar/18 22:57 Worklog Time Spent: 10m Work Description: aaltay commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-373549047 retest this please This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 81008) Time Spent: 6h 20m (was: 6h 10m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 6h 20m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=81001=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-81001 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 15/Mar/18 22:51 Start Date: 15/Mar/18 22:51 Worklog Time Spent: 10m Work Description: aaltay commented on a change in pull request #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#discussion_r174956257 ## File path: sdks/python/apache_beam/testing/test_stream.py ## @@ -46,44 +46,65 @@ class Event(object): __metaclass__ = ABCMeta - def __cmp__(self, other): -if type(self) is not type(other): - return cmp(type(self), type(other)) -return self._typed_cmp(other) - - @abstractmethod - def _typed_cmp(self, other): -raise NotImplementedError - +@total_ordering class ElementEvent(Event): """Element-producing test stream event.""" def __init__(self, timestamped_values): self.timestamped_values = timestamped_values - def _typed_cmp(self, other): -return cmp(self.timestamped_values, other.timestamped_values) + def __eq__(self, other): +return (type(self) is type(other) and +self.timestamped_values == other.timestamped_values) + + def __ne__(self, other): Review comment: Thank you. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 81001) Time Spent: 5h 50m (was: 5h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 5h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=80471=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80471 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 14/Mar/18 19:07 Start Date: 14/Mar/18 19:07 Worklog Time Spent: 10m Work Description: holdenk commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-373140138 Removed the deprecation as well, sorry about that. cc @aaltay This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 80471) Time Spent: 5h 40m (was: 5.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 5h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=80470=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80470 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 14/Mar/18 19:06 Start Date: 14/Mar/18 19:06 Worklog Time Spent: 10m Work Description: holdenk commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-373139934 So the open "test_stream" issue, you pinged someone else on it for comment? Or is there another one? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 80470) Time Spent: 5.5h (was: 5h 20m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 5.5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=80052=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80052 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 13/Mar/18 20:38 Start Date: 13/Mar/18 20:38 Worklog Time Spent: 10m Work Description: aaltay commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-372810116 @holdenk I still see that datastore helper methods are being deprecated. I thought we decided not to do that. Also there is an open question to you in `test_stream.py`. Could you address those? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 80052) Time Spent: 5h 10m (was: 5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 5h 10m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=80024=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80024 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 13/Mar/18 19:08 Start Date: 13/Mar/18 19:08 Worklog Time Spent: 10m Work Description: cclauss commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-372783645 Retest this please This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 80024) Time Spent: 5h (was: 4h 50m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 5h > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=80023=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80023 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 13/Mar/18 19:08 Start Date: 13/Mar/18 19:08 Worklog Time Spent: 10m Work Description: cclauss commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-372783645 Retest this please This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 80023) Time Spent: 4h 50m (was: 4h 40m) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 4h 50m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Work logged] (BEAM-3761) Fix Python 3 cmp function
[ https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=80008=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80008 ] ASF GitHub Bot logged work on BEAM-3761: Author: ASF GitHub Bot Created on: 13/Mar/18 18:46 Start Date: 13/Mar/18 18:46 Worklog Time Spent: 10m Work Description: holdenk commented on issue #4774: [BEAM-3761]Fix Python 3 cmp usage URL: https://github.com/apache/beam/pull/4774#issuecomment-372776648 cc @aaltay & @robertwb This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 80008) Time Spent: 4h 40m (was: 4.5h) > Fix Python 3 cmp function > - > > Key: BEAM-3761 > URL: https://issues.apache.org/jira/browse/BEAM-3761 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core >Reporter: holdenk >Priority: Major > Time Spent: 4h 40m > Remaining Estimate: 0h > > Various functions don't exist in Python 3 that did in python 2. This Jira is > to fix the use of cmp (which often will involve rewriting __cmp__ as well). > > Note: there are existing PRs for basestring and unicode ( > [https://github.com/apache/beam/pull/4697|https://github.com/apache/beam/pull/4697,] > , [https://github.com/apache/beam/pull/4730] ) > > Note once all of the missing names/functions are fixed we can enable F821 in > falke8 python 3. -- This message was sent by Atlassian JIRA (v7.6.3#76005)