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/06/02 22:09:57 UTC

[GitHub] [beam] ihji commented on a diff in pull request #17767: More flexible Python Callable type.

ihji commented on code in PR #17767:
URL: https://github.com/apache/beam/pull/17767#discussion_r888450571


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/PythonCallableSource.java:
##########
@@ -20,7 +20,27 @@
 import java.io.Serializable;
 
 /**
- * A wrapper object storing a Python code that can be evaluated to Python callables in Python SDK.
+ * A wrapper object storing a Python function definition that can be evaluated to Python callables
+ * in Python SDK.
+ *
+ * <p>The snippet of Python code can be a valid Python expression (such as {@code lambda x: x * x}
+ * or {str.upper}), a fully qualified name (such as {@code math.sin}), or a complete, multi-line
+ * function definition (such as {@code def foo(x): ...}).
+ *
+ * <p>Any lines preceding the function definition are first evaluated to provide context in which to
+ * define the function which can be useful to declare inports or any other needed values, e.g.

Review Comment:
   imports



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/PythonCallableSource.java:
##########
@@ -20,7 +20,27 @@
 import java.io.Serializable;
 
 /**
- * A wrapper object storing a Python code that can be evaluated to Python callables in Python SDK.
+ * A wrapper object storing a Python function definition that can be evaluated to Python callables
+ * in Python SDK.
+ *
+ * <p>The snippet of Python code can be a valid Python expression (such as {@code lambda x: x * x}
+ * or {str.upper}), a fully qualified name (such as {@code math.sin}), or a complete, multi-line
+ * function definition (such as {@code def foo(x): ...}).
+ *
+ * <p>Any lines preceding the function definition are first evaluated to provide context in which to
+ * define the function which can be useful to declare inports or any other needed values, e.g.

Review Comment:
   imports



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