kz930 opened a new pull request, #6810:
URL: https://github.com/apache/texera/pull/6810
### What changes were proposed in this PR?
Both `QuiverPlotOpDesc` and `RangeSliderOpDesc` carry a class-level
`@JsonSchemaInject` `attributeTypeRules` block that constrains a field named
**`value`** to numeric types — but neither operator declares a `value` field,
so the rule matches nothing and **no type constraint is applied**. The frontend
column pickers therefore allow columns of any type for fields the operator can
only handle as numeric, which then fails at chart time instead of being
prevented up front.
**QuiverPlot** — fields are `x`, `y`, `u`, `v` (all required, no `value`).
All four are used as numeric vector coordinates in `ff.create_quiver(x, y, u,
v)`, and the generated code even runtime-checks them with `isinstance(value,
(int, float))`. So all four must be numeric.
**RangeSlider** — fields are `Y-axis` and `X-axis` (no `value`). The y-axis
column is aggregated (`groupby(X-axis)[Y-axis].mean()/.sum()`), so it must be
numeric; the x-axis is only a grouping key and may be any type.
**Fix:** retarget each rule to the real `@JsonProperty` field name(s):
```diff
# QuiverPlot
- "value": {
- "enum": ["integer", "long", "double"]
- }
+ "x": { "enum": ["integer", "long", "double"] },
+ "y": { "enum": ["integer", "long", "double"] },
+ "u": { "enum": ["integer", "long", "double"] },
+ "v": { "enum": ["integer", "long", "double"] }
# RangeSlider
- "value": {
+ "Y-axis": {
"enum": ["integer", "long", "double"]
}
```
### Any related issues, documentation, discussions?
Closes #6795
### How was this PR tested?
Added a regression test to each spec that reads the class-level
`@JsonSchemaInject` `json()` via reflection and asserts the
`attributeTypeRules` keys are the real fields (`x`/`y`/`u`/`v`; `Y-axis`) — not
`value` — and that each is constrained to the numeric enum. Both fail on `main`
(the key set is `{"value"}`) and pass with this change.
```
sbt "WorkflowOperator/testOnly
org.apache.texera.amber.operator.visualization.quiverPlot.QuiverPlotOpDescSpec
org.apache.texera.amber.operator.visualization.rangeSlider.RangeSliderOpDescSpec"
...
Tests: succeeded 12, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]