Copilot commented on code in PR #5896:
URL: https://github.com/apache/texera/pull/5896#discussion_r3508650928
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/aggregate/AggregationOperation.scala:
##########
@@ -55,7 +55,23 @@ case class AveragePartialObj(sum: Double, count: Double)
extends Serializable {}
}
]
}
- }
+ },
+ "allOf": [
+ {
+ "if": {
+ "properties": {
+ "aggFunction": { "const": "count" }
+ }
+ },
+ "then": {},
+ "else": {
+ "required": ["attribute"],
+ "properties": {
+ "attribute": { "minLength": 1 }
+ }
+ }
Review Comment:
The JSON-schema conditional for non-`count` aggregations only enforces
`minLength: 1`, so whitespace-only values (e.g. " ") pass Ajv validation even
though the backend treats blank/trim-empty attributes as invalid (they will
later fail on schema lookup). To match the intended "empty/blank" rule and
avoid workflows that validate in the UI but fail at runtime, require at least
one non-whitespace character via a `pattern`.
--
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]