chamikaramj commented on code in PR #17822:
URL: https://github.com/apache/beam/pull/17822#discussion_r893939123
##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransform.java:
##########
@@ -62,7 +62,44 @@
extends PTransform<InputT, OutputT> {
private static final SchemaRegistry SCHEMA_REGISTRY =
SchemaRegistry.createDefault();
+
+ /**
+ * The fully qualified name of the a Python callable that will be use to
instantiate the
+ * transform. Often this is the fully qualified name of a PTransform class,
in which case the
+ * arguments will be passed to its constructor, but any callable will do.
+ *
+ * <p>Two special names, {@code __callable__} and {@code __constructor__}
can be used to define a
+ * suitable transform inline if none exists.
+ *
+ * <p>When {@code __callable__} is provided, the first argument (or {@code
source} keyword
+ * argument) should be a {@link PythonCallableSource} which represents the
expand method of the
+ * PTransform accepting and returning a PValue (and may also take additional
arguments and keyword
Review Comment:
{@link PTransform} and {@link PValue} (or @code if you don't want to import).
##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransform.java:
##########
@@ -62,7 +62,44 @@
extends PTransform<InputT, OutputT> {
private static final SchemaRegistry SCHEMA_REGISTRY =
SchemaRegistry.createDefault();
+
+ /**
+ * The fully qualified name of the a Python callable that will be use to
instantiate the
+ * transform. Often this is the fully qualified name of a PTransform class,
in which case the
+ * arguments will be passed to its constructor, but any callable will do.
+ *
+ * <p>Two special names, {@code __callable__} and {@code __constructor__}
can be used to define a
+ * suitable transform inline if none exists.
+ *
+ * <p>When {@code __callable__} is provided, the first argument (or {@code
source} keyword
+ * argument) should be a {@link PythonCallableSource} which represents the
expand method of the
+ * PTransform accepting and returning a PValue (and may also take additional
arguments and keyword
+ * arguments). For example, one might write
+ *
+ * <pre>
+ * PythonExternalTransform
+ * .from("__callable__")
+ * .withArgs(
+ * PythonCallable.of("def expand(pcoll, x, y): return pcoll | ..."),
+ * valueForX,
+ * valueForY);
+ * </pre>
+ *
+ * <p>When {@code __constructor__} is provided, the first argument (or
{@code source} keyword
Review Comment:
Can you please move this to the public "from(String tranformName)" method
definition and refer to that from the public "from(String tranformName, String
expansionService)" definition. Commends attached to private fields will not
show up in Java docs I believe.
##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransform.java:
##########
@@ -62,7 +62,44 @@
extends PTransform<InputT, OutputT> {
private static final SchemaRegistry SCHEMA_REGISTRY =
SchemaRegistry.createDefault();
+
+ /**
+ * The fully qualified name of the a Python callable that will be use to
instantiate the
+ * transform. Often this is the fully qualified name of a PTransform class,
in which case the
Review Comment:
{@link PTransform}
##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransform.java:
##########
@@ -62,7 +62,44 @@
extends PTransform<InputT, OutputT> {
private static final SchemaRegistry SCHEMA_REGISTRY =
SchemaRegistry.createDefault();
+
+ /**
+ * The fully qualified name of the a Python callable that will be use to
instantiate the
+ * transform. Often this is the fully qualified name of a PTransform class,
in which case the
+ * arguments will be passed to its constructor, but any callable will do.
+ *
+ * <p>Two special names, {@code __callable__} and {@code __constructor__}
can be used to define a
+ * suitable transform inline if none exists.
+ *
+ * <p>When {@code __callable__} is provided, the first argument (or {@code
source} keyword
+ * argument) should be a {@link PythonCallableSource} which represents the
expand method of the
+ * PTransform accepting and returning a PValue (and may also take additional
arguments and keyword
+ * arguments). For example, one might write
+ *
+ * <pre>
+ * PythonExternalTransform
+ * .from("__callable__")
+ * .withArgs(
+ * PythonCallable.of("def expand(pcoll, x, y): return pcoll | ..."),
+ * valueForX,
+ * valueForY);
+ * </pre>
+ *
+ * <p>When {@code __constructor__} is provided, the first argument (or
{@code source} keyword
+ * argument) should be a {@link PythonCallableSource} which will return the
desired PTransform
+ * when called with the remaining arguments and keyword arguments. Often
this will be a
+ * PythonCallable representing a PTransform class, for example
Review Comment:
{@code PythonCallable}
##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransform.java:
##########
@@ -62,7 +62,44 @@
extends PTransform<InputT, OutputT> {
private static final SchemaRegistry SCHEMA_REGISTRY =
SchemaRegistry.createDefault();
+
+ /**
+ * The fully qualified name of the a Python callable that will be use to
instantiate the
Review Comment:
s/use/used
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]