DanielLeens commented on code in PR #11048:
URL: https://github.com/apache/seatunnel/pull/11048#discussion_r3401595532
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/Condition.java:
##########
@@ -219,6 +234,9 @@ private static String conditionToString(Condition<?> cond) {
ConditionOperator op = cond.operator;
String key = "'" + cond.option.key() + "'";
+ if (op == ConditionOperator.EXTENSION) {
+ return key + " " + cond.extension.description();
Review Comment:
Thanks for calling this out. Rechecking the current contract,
ConditionExtension.description() is now documented as non-null and both
metadata consumers only serialize that descriptive string, so I would still
treat a null return as a plugin-implementation bug rather than a framework-side
blocker on this revision. If we later decide to harden against buggy
extensions, we can follow up with a defensive null normalization separately.
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConditionEvaluators.java:
##########
@@ -169,6 +169,14 @@ private static Map<ConditionOperator, Evaluator>
createRegistry() {
return compareNumbers(v, other) >= 0;
});
+ // Extension (custom logic delegated to ConditionExtension)
+ m.put(
+ ConditionOperator.EXTENSION,
+ (v, c, cfg) -> {
+ ConditionExtension<Object> ext =
(ConditionExtension<Object>) c.getExtension();
Review Comment:
Thanks. On the current runtime path, ConditionOperator.EXTENSION conditions
are created through Conditions.extension(...), which pairs the Option<T> and
ConditionExtension<T> at construction time. Given that factory contract, I do
not see a new blocker on the unchanged head here. If the framework later adds a
looser deserialization or reflection-based construction path for Condition,
then adding a defensive type guard would be worth revisiting.
--
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]