beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (BEAM-4007) Futurize and fix python 2 compatibility for typehints subpackage
Date Wed, 13 Jun 2018 08:26:00 GMT


ASF GitHub Bot logged work on BEAM-4007:

                Author: ASF GitHub Bot
            Created on: 13/Jun/18 08:25
            Start Date: 13/Jun/18 08:25
    Worklog Time Spent: 10m 
      Work Description: RobbeSneyders commented on a change in pull request #5337: [BEAM-4007]
Futurize typehints subpackage

 File path: sdks/python/apache_beam/typehints/
 @@ -411,17 +416,23 @@ def __eq__(self, other):
   def __repr__(self):
     return 'Any'
+  def __hash__(self):
+    return hash(id(self))
   def type_check(self, instance):
 class TypeVariable(AnyTypeConstraint):
+  def __init__(self, name):
+ = name
   def __eq__(self, other):
     return type(self) == type(other) and ==
-  def __init__(self, name):
- = name
+  def __hash__(self):
 Review comment:
   This is again the same issue as mentioned above.
   I actually think it might make more sense to change `__eq__` to be instance specific. If
I specify `K = beam.typehints.TypeVariable('K')` in two separate places in my code base, I
might not want them match.
   However, this might break some existing pipelines. I therefore tried to use the equivalent
of the Python 2 code.
   What do you think?

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

> Futurize and fix python 2 compatibility for typehints subpackage
> ----------------------------------------------------------------
>                 Key: BEAM-4007
>                 URL:
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Robbe
>            Assignee: Robbe
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h

This message was sent by Atlassian JIRA

View raw message