The GitHub Actions job "Required Checks" on 
texera.git/backport/6810-retarget-numeric-attributetyperules-to-r-v1.2 has 
failed.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
227d573699b79ea1923e805cf5c5b81f2fb51c3f / Kary Zheng 
<[email protected]>
fix(QuiverPlot, RangeSlider): retarget numeric attributeTypeRules to real 
fields (#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)

---------

(backported from commit 1c411dedaad2bb8bd8fd4f5301843ae1f2f1c781)

Signed-off-by: Kary Zheng <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Copilot Autofix powered by AI 
<[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/30422950417

With regards,
GitHub Actions via GitBox

Reply via email to