You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/08 21:48:50 UTC

[GitHub] [beam] udim commented on a change in pull request #11038: [BEAM-7746] More typing fixes

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

 ##########
 File path: sdks/python/apache_beam/coders/coders.py
 ##########
 @@ -387,8 +387,11 @@ def register_structured_urn(urn, cls):
     """Register a coder that's completely defined by its urn and its
     component(s), if any, which are passed to construct the instance.
     """
-    cls.to_runner_api_parameter = (
-        lambda self, unused_context: (urn, None, self._get_component_coders()))
+    setattr(
 
 Review comment:
   I guess set/getattr is cleaner. If this becomes commonplace in the codebase then perhaps we don't need the comment (and mypy will give an error if you attempt to use regular assignment).
   
   ref: https://github.com/python/mypy/issues/2427#issuecomment-259677994 (though I don't fully get the examples)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services