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 2022/08/26 01:32:28 UTC

[GitHub] [beam] TheNeuralBit commented on a diff in pull request #22899: Make RowTypeConstraint callable, test nested optional row in schemas and RowCoder

TheNeuralBit commented on code in PR #22899:
URL: https://github.com/apache/beam/pull/22899#discussion_r955562867


##########
sdks/python/apache_beam/typehints/row_type.py:
##########
@@ -123,6 +123,12 @@ def from_fields(
         field_options=field_options,
         schema_registry=schema_registry)
 
+  def __call__(self, *args, **kwargs):
+    # We make RowTypeConstraint callable (defers to constructing the user type)

Review Comment:
   I'm not sure if there's a better reference on this, but the CPython implementation explicitly considers anything that's callable a type:
   https://github.com/python/cpython/blob/d348afa15d5a997e7a8e51c0f789f41cb15cc651/Lib/typing.py#L137-L167



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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org