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

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

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

 ##########
 File path: sdks/python/apache_beam/io/iobase.py
 ##########
 @@ -972,14 +979,15 @@ def expand(self, pcoll):
                        'or be a PTransform. Received : %r' % self.sink)
 
 
-class WriteImpl(ptransform.PTransform):
+class WriteImpl(ptransform.PTransform[InT, None]):
   """Implements the writing of custom sinks."""
 
   def __init__(self, sink):
     super(WriteImpl, self).__init__()
     self.sink = sink
 
   def expand(self, pcoll):
+    # type: (pvalue.PCollection[InT]) -> pvalue.PCollection[None]
 
 Review comment:
   IIUC, mypy will compare this annotation to the output of the plugin you 
wrote?
 
----------------------------------------------------------------
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: 278386)
    Time Spent: 1h 40m  (was: 1.5h)

> 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: 1h 40m
>  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