chadrik commented on a change in pull request #11038: [BEAM-7746] More typing
fixes
URL: https://github.com/apache/beam/pull/11038#discussion_r393185957
##########
File path: sdks/python/apache_beam/runners/pipeline_context.py
##########
@@ -48,19 +55,33 @@
from apache_beam.coders.coder_impl import IterableStateReader
from apache_beam.coders.coder_impl import IterableStateWriter
+PortableObjectT = TypeVar('PortableObjectT', bound='PortableObject')
+
+
+class PortableObject(Protocol):
+ def to_runner_api(self, __context):
+ # type: (PipelineContext) -> Any
+ pass
-class _PipelineContextMap(object):
+ @classmethod
+ def from_runner_api(cls, __proto, __context):
+ # type: (Any, PipelineContext) -> Any
+ pass
Review comment:
shall we go with an adjective here instead of a noun: `Portable`?
----------------------------------------------------------------
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]
With regards,
Apache Git Services