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

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

                Author: ASF GitHub Bot
            Created on: 02/Apr/18 19:57
            Start Date: 02/Apr/18 19:57
    Worklog Time Spent: 10m 
      Work Description: charlesccychen commented on a change in pull request 
#4990: [BEAM-3981] Futurize and fix python 2 compatibility for coders subpackage
URL: https://github.com/apache/beam/pull/4990#discussion_r178633467
 
 

 ##########
 File path: sdks/python/apache_beam/coders/coder_impl.py
 ##########
 @@ -278,38 +277,38 @@ def get_estimated_size_and_observables(self, value, 
nested=False):
     return out.get_count(), []
 
   def encode_to_stream(self, value, stream, nested):
-    t = type(value)
-    if t is NoneType:
+    if value is None:
       stream.write_byte(NONE_TYPE)
 
 Review comment:
   <!--new_thread; commit:05e95b6995f0b88a53930c30459c8d81e6692219; 
resolved:0-->
   Can you revert the change removing `t = type(value)`?  I believe this is 
done because `isinstance` is much slower than `is`, and this is very 
performance-sensitive code.
   
   CC: @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: 86732)
    Time Spent: 2.5h  (was: 2h 20m)

> 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: 2.5h
>  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