yunfengzhou-hub commented on code in PR #1159:
URL: https://github.com/apache/flink-agents/pull/1159#discussion_r4140036168
##########
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:
Done — both PythonFunction and JavaFunction now reject an empty identifier
in the constructor alongside the null checks, so every construction path fails
up front rather than at dispatch. Regression tests added on both sides.
Besides, both cross-language E2E agents now use the declarative form instead
of addAction/add_action: JavaAgentWithPythonActionAgent declares an @Action
PythonFunction field, and PythonAgentWithJavaActionAgent declares
action(...)(JavaFunction.for_action(...)). Both run in the real cross-language
E2E now, not just plan compilation.
--
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]