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

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

                Author: ASF GitHub Bot
            Created on: 25/Sep/20 01:54
            Start Date: 25/Sep/20 01:54
    Worklog Time Spent: 10m 
      Work Description: chadrik edited a comment on pull request #12881:
URL: https://github.com/apache/beam/pull/12881#issuecomment-698675941


   > > 23:36:24 apache_beam/runners/worker/data_plane.py:714: error: 
Incompatible return value type (got "Optional[GrpcClientDataChannel]", expected 
"GrpcClientDataChannel")  [return-value]
   > 
   > Sure this shouldn't return optional as well?
   
   When I do that, it just causes errors elsewhere.  I couldn't find a 
solution.  I think there's some implicit guarantee going on here.  I'd like to 
identify where it is and add an assert, a cast, and/or a comment, but I don't 
know the system well enough.
   
   > > 23:36:24 apache_beam/runners/worker/operations.py:722: error: Argument 1 
to "append" of "list" has incompatible type "Tuple[DoOperation, 
Iterable[SplitResultResidual]]"; expected "Tuple[DoOperation, 
SplitResultResidual]"  [arg-type]
   > 
   > self.dofn_runner.process does return an `Iterable[SplitResultResidual]`
   
   yeah, the problem is that `self.execution_context.delayed_applications` is a 
list of `Tuple[..., SplitResultResidual]`.  
    and we're trying to append to that a `Tuple[..., 
Iterable[SplitResultResidual]]`.   Should this be a list of `Union`, or is 
something wrong here?
   
   > > 23:36:24 apache_beam/runners/worker/bundle_processor.py:241: error: 
Signature of "try_split" incompatible with supertype "Operation"  [override]
   > 
   > The supertype returns Optional[Any], which should be compatible with this.
   
   The number of arguments is different. 
   
   > 
   > > 23:36:24 apache_beam/runners/worker/bundle_processor.py:978: error: 
"Operation" has no attribute "add_timer_info"  [attr-defined]
   > > 23:36:24 apache_beam/runners/worker/bundle_processor.py:990: error: 
"Operation" has no attribute "process_timer"  [attr-defined]
   > 
   > These will always be DoOperations.
   
   Does `create_execution_tree` return `OrderedDict[str, 
operations.DoOperation]`? 
   
   
   > 
   > > 23:36:24 apache_beam/runners/worker/bundle_processor.py:1568: error: 
Argument 5 to "StateBackedSideInputMap" has incompatible type "Coder"; expected 
"WindowedValueCoder"  [arg-type]
   > 
   > I think this will always hold, we just don't know it due to having 
deserialized it with the generic mechanisms.
   
   I changed `BeamTransformFactory.get_input_coders` to return `Dict[str, 
coders.WindowedValueCoder]`.  Does that seem right?
   
   


----------------------------------------------------------------
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: 490524)
    Time Spent: 99h 40m  (was: 99.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: P3
>          Time Spent: 99h 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
(v8.3.4#803005)

Reply via email to