The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-9042-f80f6f79b3b060be7051b672fd549d99afb9b56d
 has succeeded.
Run started by GitHub user kunwp1 (triggered by kunwp1).

Head commit for run:
f863ad26ddb3083bf2cc7e4105255e1010a8bbf0 / Eugene Gu <[email protected]>
feat(workflow-operator): volcano plot hover column (#9042)

### What changes were proposed in this PR?

The Volcano Plot uses `hover_name=table.columns[0]`, so the tooltip
label is whatever column comes first in the input. That is fine for a
DESeq2 table starting with `gene` and useless for one starting with a
composite id or a number, and there is no way to change it. This PR
copies Scatter Plot's `Hover column` property over, one column only.

| Hover column | Result |
|---|---|
| empty or whitespace-only (default) | `hover_name=table.columns[0]`,
unchanged for saved workflows |
| set, present in the input | `hover_name=<that column>` |
| set, missing from the input | the operator's error page `Missing hover
column in table.`, like the existing check for the two required columns
(Scatter Plot lets plotly raise a `ValueError` here) |

Since #8504 merged, the operator also exports a standalone script
through `generateStandaloneCode()`, which had
`hover_name=table.columns[0]` hard-coded. This PR mirrors the property
there: the hover column goes in as an escaped Python literal, and a set
column that the input lacks adds one more `elif` to the script's column
checks, writing the same error page. Whether the field counts as empty
is decided by one helper for both paths, so the exported figure and the
engine's cannot disagree.

The label fix (#9037) has landed and this branch is merged with it. The
hover column is independent of it: the merged operator differs from
`main` only by the hover property, its checks and the two `hover_name`
arguments. The PR for the significance thresholds (#9039) touches
neighbouring lines of `VolcanoPlotOpDesc.scala`, so whichever of the two
lands second needs a small merge.

Figures below are the operator's generated Python from `main` and from
this branch (Hover column = `gene`), run on the 430-gene example
workflow from the issue whose first column is
`transcript|gene|chr|strand`; the same point is hovered in both.

| Before | After (Hover column = gene) |
|---|---|
| <img width="1398" height="849" alt="hover-before-first-column"
src="https://github.com/user-attachments/assets/57df5276-196c-45b4-946d-098d77f739cb";
/> | <img width="1398" height="849" alt="hover-after-gene"
src="https://github.com/user-attachments/assets/2aca08f2-e817-4ea2-940f-ce90eeb447e4";
/> |

### Any related issues, documentation, discussions?

Closes #9038

PR #8504 (merged) added the `generateStandaloneCode()` export path with
the same `hover_name=table.columns[0]`; the mirroring described above is
the follow-up it needed.

### How was this PR tested?

New tests in `VolcanoPlotOpDescSpec`, written before the source change:

- empty or whitespace-only field keeps `hover_name=table.columns[0]` and
emits no hover check
- a set field emits the decoded column as `hover_name` plus the presence
check, and no `table.columns[0]`
- a column name with quotes and non-ASCII text reaches the code only as
a decode site
- a workflow JSON saved before this change generates byte-for-byte the
same code as a default-constructed operator
- `generateStandaloneCode`: an empty field keeps
`hover_name=table.columns[0]` and adds no check; a set field is emitted
as a literal plus an exact five-line `elif` branch between the
required-column check and the drawing branch; a name with quotes,
non-ASCII text or a backslash comes out escaped rather than decoded;
whitespace-only equals empty

```
sbt -Dsbt.server.forcestart=true "WorkflowOperator/testOnly 
*VolcanoPlotOpDescSpec"
# Tests: succeeded 24, failed 0, canceled 0, ignored 0, pending 1   (the 
pending one is pre-existing; the count includes the label tests now on main)

sbt -Dsbt.server.forcestart=true "WorkflowOperator/scalafmtAll" 
"WorkflowOperator/Test/scalafmtAll"
sbt -Dsbt.server.forcestart=true "WorkflowOperator/scalafixAll --check"
# success
```

Smoke run outside Texera (pytexera stubbed, pandas + plotly 5.24.1) on
the 430-gene mock table: defaults hover-label the first point as
`ENST00000000000|GENE_0000|chr2|+`; Hover column = `gene` gives
`GENE_0000`; Hover column = `no_such_column` yields `<h1>Volcano Plot
failed</h1><p>Missing hover column in table.</p>`. The exported script
for the default and the `gene` configuration parses with `ast.parse`.

### Was this PR authored or co-authored using generative AI tooling?

Yes. Generated-by: Claude Code (claude-fable-5-1). Co-authored with
Claude; the author reviewed the change before submission.

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

With regards,
GitHub Actions via GitBox

Reply via email to