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

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

                Author: ASF GitHub Bot
            Created on: 17/Jul/19 21:56
            Start Date: 17/Jul/19 21:56
    Worklog Time Spent: 10m 
      Work Description: chadrik commented on pull request #9056: [BEAM-7746] 
Add python type hints
URL: https://github.com/apache/beam/pull/9056#discussion_r304659145
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/ptransform.py
 ##########
 @@ -465,56 +484,70 @@ def get_windowing(self, inputs):
     return inputs[0].windowing
 
   def __rrshift__(self, label):
+    # type: (str) -> _NamedPTransform[InT, OutT]
     return _NamedPTransform(self, label)
 
   def __or__(self, right):
+    # type: (PTransform[InT, OutT], PTransform[OutT, T]) -> 
_ChainedPTransform[OutT, T]
     """Used to compose PTransforms, e.g., ptransform1 | ptransform2."""
     if isinstance(right, PTransform):
       return _ChainedPTransform(self, right)
     return NotImplemented
 
-  def __ror__(self, left, label=None):
-    """Used to apply this PTransform to non-PValues, e.g., a tuple."""
-    pvalueish, pvalues = self._extract_input_pvalues(left)
-    pipelines = [v.pipeline for v in pvalues if isinstance(v, pvalue.PValue)]
-    if pvalues and not pipelines:
-      deferred = False
+  if not typing.TYPE_CHECKING:
 
 Review comment:
   ah, sorry, I missed the context here.  yeah, that would be a nice feature.  
would be worth bringing up at the mypy github repo.
   
   note that this change is to accommodate analyzing user pipelines via the 
mypy plugin, which  I'm now thinking would be best to separate into another PR. 
  With some more hacking, I might ultimately be able to avoid this bit of 
ugliness.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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: 278512)
    Time Spent: 3h 20m  (was: 3h 10m)

> Add type hints to python code
> -----------------------------
>
>                 Key: BEAM-7746
>                 URL: https://issues.apache.org/jira/browse/BEAM-7746
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py-core
>            Reporter: Chad Dombrova
>            Priority: Major
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> As a developer of the beam source code, I would like the code to use pep484 
> type hints so that I can clearly see what types are required, get completion 
> in my IDE, and enforce code correctness via a static analyzer like mypy.
> This may be considered a precursor to BEAM-7060
> Work has been started here:  [https://github.com/apache/beam/pull/9056]
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to