ASF GitHub Bot logged work on BEAM-3981:

                Author: ASF GitHub Bot
            Created on: 12/Apr/18 08:39
            Start Date: 12/Apr/18 08:39
    Worklog Time Spent: 10m 
      Work Description: RobbeSneyders commented on a change in pull request 
#5053: [BEAM-3981] Futurize coders subpackage
URL: https://github.com/apache/beam/pull/5053#discussion_r181005086

 File path: sdks/python/apache_beam/coders/coder_impl.py
 @@ -279,21 +282,21 @@ def get_estimated_size_and_observables(self, value, 
   def encode_to_stream(self, value, stream, nested):
     t = type(value)
-    if t is NoneType:
+    if value is None:
     elif t is int:
     elif t is float:
-    elif t is str:
-      stream.write_byte(STR_TYPE)
+    elif t is bytes:
+      stream.write_byte(BYTES_TYPE)
       stream.write(value, nested)
-    elif t is six.text_type:
-      unicode_value = value  # for typing
-      stream.write_byte(UNICODE_TYPE)
-      stream.write(unicode_value.encode('utf-8'), nested)
+    elif t is unicode:
+      text_value = value  # for typing
 Review comment:
   I tried this, but it throws a 'not a type' error for `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:

Issue Time Tracking

    Worklog Id:     (was: 90326)
    Time Spent: 7h 50m  (was: 7h 40m)

> 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: Ahmet Altay
>            Priority: Major
>          Time Spent: 7h 50m
>  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

Reply via email to