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

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

                Author: ASF GitHub Bot
            Created on: 08/Jun/18 21:24
            Start Date: 08/Jun/18 21:24
    Worklog Time Spent: 10m 
      Work Description: robertwb closed pull request #5586: [BEAM-3981] Cleanup 
of coders futurization.
URL: https://github.com/apache/beam/pull/5586
 
 
   

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/coders/coder_impl.py 
b/sdks/python/apache_beam/coders/coder_impl.py
index 2fcd0f22a31..78d692c1f76 100644
--- a/sdks/python/apache_beam/coders/coder_impl.py
+++ b/sdks/python/apache_beam/coders/coder_impl.py
@@ -15,6 +15,8 @@
 # limitations under the License.
 #
 
+# cython: language_level=3
+
 """Coder implementations.
 
 The actual encode/decode implementations are split off from coders to
@@ -32,7 +34,6 @@
 from __future__ import absolute_import
 from __future__ import division
 
-import sys
 from builtins import chr
 from builtins import object
 
@@ -310,13 +311,7 @@ def encode_to_stream(self, value, stream, nested):
       dict_value = value  # for typing
       stream.write_byte(DICT_TYPE)
       stream.write_var_int64(len(dict_value))
-      # Use iteritems() on Python 2 instead of future.builtins.iteritems to
-      # avoid performance regression in Cython compiled code.
-      if sys.version_info[0] == 2:
-        items = dict_value.iteritems()  # pylint: disable=dict-iter-method
-      else:
-        items = dict_value.items()
-      for k, v in items:
+      for k, v in dict_value.items():
         self.encode_to_stream(k, stream, True)
         self.encode_to_stream(v, stream, True)
     elif t is bool:


 

----------------------------------------------------------------
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: 110284)
    Time Spent: 20h 20m  (was: 20h 10m)

> Futurize and fix python 2 compatibility for coders package
> ----------------------------------------------------------
>
>                 Key: BEAM-3981
>                 URL: https://issues.apache.org/jira/browse/BEAM-3981
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Robbe
>            Assignee: Robbe
>            Priority: Major
>             Fix For: Not applicable
>
>          Time Spent: 20h 20m
>  Remaining Estimate: 0h
>
> Run automatic conversion with futurize tool on coders subpackage and fix 
> python 2 compatibility. This prepares the subpackage for python 3 support.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to