You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/05/01 00:29:00 UTC

[jira] [Work logged] (BEAM-7372) Clean up Python 2 codepaths once Beam no longer supports Python 2.

     [ https://issues.apache.org/jira/browse/BEAM-7372?focusedWorklogId=591782&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-591782 ]

ASF GitHub Bot logged work on BEAM-7372:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/May/21 00:28
            Start Date: 01/May/21 00:28
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #14634:
URL: https://github.com/apache/beam/pull/14634#discussion_r624325738



##########
File path: sdks/python/apache_beam/examples/complete/top_wikipedia_sessions.py
##########
@@ -93,9 +93,8 @@ def expand(self, pcoll):
         | 'TopPerMonthWindow' >> beam.WindowInto(
             FixedWindows(size=THIRTY_DAYS_IN_SECONDS))
         | 'Top' >> combiners.core.CombineGlobally(
-            combiners.TopCombineFn(
-                10,
-                lambda first, second: first[1] < second[1])).without_defaults())
+            combiners.TopCombineFn(n=10,
+                                   key=lambda x: x[1])).without_defaults())

Review comment:
       sessions_count SGTM, thanks.
   combiners.TopCombineFn is a public api, so this would mean an API change. If we had an API change, some users could be broken by this PR. But I suspect we don't have an API change for Py3 users, since we already disallowed compare on py3, and this example was already not working on Python 3, and will start working after this change. Does this sound correct?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 591782)
    Time Spent: 65h  (was: 64h 50m)

> Clean up Python 2 codepaths once Beam no longer supports Python 2.
> ------------------------------------------------------------------
>
>                 Key: BEAM-7372
>                 URL: https://issues.apache.org/jira/browse/BEAM-7372
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Valentyn Tymofieiev
>            Priority: P3
>              Labels: P3
>          Time Spent: 65h
>  Remaining Estimate: 0h
>
> There are several places in Beam where we branch based on Python version. Once Python 2 is no longer supported, we can remove Py2 parts of the branch.
> To find places to clean up, we can search for "Python 2", "Python 3", "Py2", "sys.version_info", BEAM-8371, etc.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)