[ https://issues.apache.org/jira/browse/BEAM-7746?focusedWorklogId=372686&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372686 ]
ASF GitHub Bot logged work on BEAM-7746: ---------------------------------------- Author: ASF GitHub Bot Created on: 16/Jan/20 01:04 Start Date: 16/Jan/20 01:04 Worklog Time Spent: 10m Work Description: chadrik commented on pull request #10593: [BEAM-7746] Add typing for try_split URL: https://github.com/apache/beam/pull/10593#discussion_r367185543 ########## File path: sdks/python/apache_beam/runners/common.py ########## @@ -61,6 +61,9 @@ from apache_beam.transforms import sideinputs from apache_beam.transforms.core import TimerSpec +SplitResultType = Tuple[ Review comment: I agree it would help a bit. I searched around for places where we access individual elements of this tuple, and there aren't many cases. Here's the one I found: ```python def bundle_application(self, op, # type: operations.DoOperation primary # type: common.SplitResultType ): ((element_and_restriction, output_watermark), _) = primary return self.construct_bundle_application( op, output_watermark, element_and_restriction) ``` What name would you give to each item? ```python SplitResult = NamedTuple( 'SplitResult', [ ('???', Tuple[WindowedValue, Optional[Timestamp]]), ('???', Optional[Timestamp]) ]) ``` ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 372686) Time Spent: 53.5h (was: 53h 20m) > 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 > Assignee: Chad Dombrova > Priority: Major > Time Spent: 53.5h > 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)