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

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

                Author: ASF GitHub Bot
            Created on: 21/Jun/18 17:33
            Start Date: 21/Jun/18 17:33
    Worklog Time Spent: 10m 
      Work Description: RobbeSneyders commented on a change in pull request 
#5337: [BEAM-4007] Futurize typehints subpackage
URL: https://github.com/apache/beam/pull/5337#discussion_r197217670
 
 

 ##########
 File path: sdks/python/apache_beam/typehints/typecheck.py
 ##########
 @@ -87,14 +92,14 @@ def wrapper(self, method, args, kwargs):
     except TypeCheckError as e:
       error_msg = ('Runtime type violation detected within ParDo(%s): '
                    '%s' % (self.full_label, e))
-      six.raise_from(TypeCheckError(error_msg), sys.exc_info()[2])
+      raise_with_traceback(TypeCheckError(error_msg))
     else:
       return self._check_type(result)
 
   def _check_type(self, output):
     if output is None:
       return output
-    elif isinstance(output, (dict,) + six.string_types):
+    elif isinstance(output, (dict, str, unicode)):
 
 Review comment:
   I don't think we need to add `bytes` here.
   `six.string_types` is equivalent to `basestring` on python 2 and `str` on 
python 3. `(str, unicode)` is equivalent to `basestring` on Python 2 and here 
also equivalent to `str` on Python 3 due to the `unicode=str` assignment.

----------------------------------------------------------------
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: 114404)
    Time Spent: 3h  (was: 2h 50m)

> Futurize and fix python 2 compatibility for typehints subpackage
> ----------------------------------------------------------------
>
>                 Key: BEAM-4007
>                 URL: https://issues.apache.org/jira/browse/BEAM-4007
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Robbe
>            Assignee: Robbe
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>




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

Reply via email to