wenjin272 commented on code in PR #1159:
URL: https://github.com/apache/flink-agents/pull/1159#discussion_r4120096185
##########
api/src/main/java/org/apache/flink/agents/api/function/PythonFunction.java:
##########
@@ -48,6 +48,15 @@ public PythonFunction(
this.qualName = Objects.requireNonNull(qualName, "qualName");
}
+ /**
+ * Convenience factory for a Python cross-language target, mirroring {@code
+ * JavaFunction.forAction}. Reads naturally in the annotated-field form:
{@code
+ * PythonFunction.of( "my_pkg.handlers", "handle_input")}.
+ */
+ public static PythonFunction of(String module, String qualName) {
+ return new PythonFunction(module, qualName);
+ }
Review Comment:
Could we reject empty `module` and `qualName` in the constructor, alongside
the null checks, and add regression tests? The old annotation path rejected
partially specified targets, but the new field declaration accepts them and
defers the failure to runtime.
--
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]