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:
[email protected]


With regards,
Apache Git Services

Reply via email to