kz930 opened a new issue, #6728:
URL: https://github.com/apache/texera/issues/6728
### What happened?
`FilledAreaPlotOpDesc` has a check (`performTableCheck()`) that decides,
when a **Line
Group** is set, whether the groups share the same x-axis. If they don't, it
shows an
error page instead of drawing the chart.
That check has one line that writes to `X_values` (capital X), while every
other line in
the block uses lowercase `x_values`:
**File:**
`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/filledAreaPlot/FilledAreaPlotOpDesc.scala`
(in `performTableCheck()`, ~line 124)
```python
for _, group in grouped:
if x_values == None:
x_values = set(group[x].unique())
elif set(group[x].unique()).intersection(x_values):
X_values = x_values.union(set(group[x].unique())) # <-- capital X:
result is never used
elif not set(group[x].unique()).intersection(x_values):
count += 1
if count > tolerance:
error = "X attributes not shared across groups"
```
`X_values` is assigned once and **never read** (not in this file, not
anywhere in the
repo), so the `union(...)` is thrown away. Because of this, `x_values` never
grows, and
the check compares each group only against the **first** group — instead of
against all
groups seen so far.
**Why this is a bug:** it rejects inputs that plotly can render perfectly
well.
`px.area` draws each line group as a stacked area and stacks them over the
**union** of
all x-values (missing points filled with 0, `stackgaps="infer zero"` by
default). So the
"compare against everything so far" (union) reading is the one that matches
how the
chart actually works — the current code is both a dead store and too strict.
I confirmed this by running the check logic and `px.area` on the sample data
below:
current code → `error = "X attributes not shared across groups"`; with
`X_values`
changed to `x_values` → `error = ""`; and `px.area` renders the data fine (3
traces).
The line has been here since the operator was first added in #2086, and
later PRs
(#2994, #3111) carried it over unchanged.
**Suggested fix** (low priority): please confirm the intent. If groups
should be
compared against all x-values seen so far, this is a one-character fix
(`X_values` → `x_values`). If comparing only to the first group was
intended, the dead
line should be removed.
### How to reproduce?
Add a **Filled Area Plot** with **Line Group** set, and give it groups that
overlap in a
chain but where the last group shares no x with the first:
| x | y | grp |
|---|---|-----|
| 1 | 10 | A |
| 2 | 10 | A |
| 2 | 10 | B |
| 3 | 10 | B |
| 3 | 10 | C |
| 4 | 10 | C |
(A = {1,2}, B = {2,3}, C = {3,4}: A–B share `2`, B–C share `3`, but C shares
nothing
with A.)
Config: X = `x`, Y = `y`, Line Group = `grp`.
- **Expected:** a stacked area chart (plotly renders this fine).
- **Actual:** no chart — an error page: *"X attribute is not shared across
all line groups."*
### Version/Branch
1.3.0-incubating-SNAPSHOT (main)
### Commit Hash (Optional)
_No response_
### What browsers are you seeing the problem on?
_No response_
### Relevant log output
```shell
```
--
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]