[
https://issues.apache.org/jira/browse/BEAM-3761?focusedWorklogId=117804&page=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 <[email protected]>
**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 | [](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/)
| --- | --- | --- | --- | --- | ---
Java | [](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/)
| --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)
</br> [](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| --- | --- | --- | ---
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 117804)
Time Spent: 8h (was: 7h 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: 8h
> 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)