udim commented on a change in pull request #11038: [BEAM-7746] More typing fixes
URL: https://github.com/apache/beam/pull/11038#discussion_r405852662
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/core.py
 ##########
 @@ -1300,12 +1300,13 @@ def to_runner_api_parameter(self, context):
           common_urns.requirements.REQUIRES_STATEFUL_PROCESSING.urn)
     from apache_beam.runners.common import DoFnSignature
     sig = DoFnSignature(self.fn)
-    is_splittable = sig.is_splittable_dofn()
 
 Review comment:
   I don't know why, but `ParDoPayload` below accepts both splittable and 
restriction_coder_id keywords (theoretically splittable might be True while 
restriction_coder_id is None), so I think it's safer to do this:
   ```py
   is_splittable = sig.is_splittable_dofn()
   restriction_coder = sig.get_restriction_coder()
   if restriction_coder:
     restriction_coder_id = context.coders.get_id(
         restriction_coder)  # type: typing.Optional[str]
   else:
     restriction_coder_id = None
   ```

----------------------------------------------------------------
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

Reply via email to