The GitHub Actions job "Benchmarks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
713834a553dc2214b597caa5ce6c4b31ec60dd01 / Eugene Gu <[email protected]>
feat(workflow-operator): volcano plot labels follow columns (#9040)

### What changes were proposed in this PR?

Root cause: `VolcanoPlotOpDesc.generatePythonCode` hard-codes the y
column as the literal `"-log10(pvalue)"` and plots it under that name,
so the y axis always says `-log10(pvalue)` even when the selected column
is `padj`. The title is the literal `"Volcano Plot"` and the x axis and
color bar show the raw effect column name. None of this can be changed
from the property panel.

```
Before:  P-Value Column = padj  ->  y column "-log10(pvalue)"  ->  y axis 
"-log10(pvalue)"
After:   P-Value Column = padj  ->  y column "-log10(padj)"    ->  y axis 
"-log10(padj)", or the Y Label the user typed
```

The y column is now named after the selected p-value column, so the axis
and the hover text say which column was transformed. Three optional
label properties are added, empty by default:

| Property | Empty | Set |
|---|---|---|
| Title | `Volcano Plot` | the text typed |
| X Label | effect column name | the text typed |
| Y Label | `-log10(<p-value column>)` | the text typed |

The color bar has no label of its own: the points are colored by the
effect column, the same column that is on the x axis, so the color bar
carries the X Label text (or the effect column name when X Label is
empty). If a later change lets the color encode a different column, a
label for it would come with that change.

The labels go through `fig.update_layout(xaxis_title, yaxis_title,
coloraxis_colorbar_title_text)`, same as Line Chart's X Label / Y Label.
Each label is an `EncodableString`, so quotes and non-ASCII text are
fine. A whitespace-only field counts as empty. The hover box still shows
raw column names (plotly behaviour, same as Line Chart).

Behavior change for saved workflows: a workflow with `padj` as the
p-value column now renders `-log10(padj)` instead of `-log10(pvalue)`.
That is the fix.

Since #8504 merged, the operator also has an export path,
`generateStandaloneCode()`, which writes the same figure as a standalone
script. It carried the same hard-coded `"-log10(pvalue)"` and
`title="Volcano Plot"`, so this PR applies the same change there: the y
column is named after the selected p-value column and the three labels
go through `fig.update_layout` as escaped Python literals (the export
has no decoder, so `pyStringLiteral` escapes quotes and backslashes).
The engine template and the exported script now label the figure the
same way.

Rebase note: `coloraxis_colorbar_title_text` is emitted unconditionally,
in both templates. Once the PR for the significance coloring (#9039)
lands, the categorical mode has no `coloraxis`, so whichever branch
rebases second needs to make that entry conditional.

Figures below are the operator's generated Python from `main` and from
this branch, run on the 430-gene example workflow from the issue; the
third one has the title and both axis labels filled in.

| Before | After (defaults) | After (labels set) |
|---|---|---|
| <img width="1398" height="849" alt="before-main"
src="https://github.com/user-attachments/assets/0c0dd5ef-3675-44e2-98f6-236b54bd631b";
/> | <img width="1398" height="849" alt="labels-after-default"
src="https://github.com/user-attachments/assets/ee8dc430-2142-47ac-947f-59c535c2b308";
/> | <img width="1398" height="849" alt="labels-after-custom"
src="https://github.com/user-attachments/assets/8299992d-d84d-48fe-9556-e66a8579e859";
/> |

### Any related issues, documentation, discussions?

Closes #9037

PR #8504 (merged) added the `generateStandaloneCode()` export path with
the same hard-coded `"-log10(pvalue)"`; the mirroring described above is
the follow-up it needed.

### How was this PR tested?

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

- y column and axis are named after the selected p-value column; the old
literal is gone
- every label falls back to its default when empty or whitespace-only
- a set label replaces its default and reaches the code only as a decode
site (sentinels with quotes, backslash, non-ASCII)
- the color bar title follows X Label when it is set and the effect
column name otherwise
- one set label leaves the other two at their defaults
- a workflow JSON saved before this change (only the two column keys)
generates byte-for-byte the same code as a default-constructed operator
- `generateStandaloneCode`: the y column and axis are named after the
p-value column (including a name with a quote, `p"adj`), the labels fall
back to the column-derived defaults, a set label is emitted as an
escaped literal and the default title is gone, the color bar carries the
X Label text, and whitespace-only keeps the default

```
sbt -Dsbt.server.forcestart=true "WorkflowOperator/testOnly 
*VolcanoPlotOpDescSpec"
# Tests: succeeded 15, failed 0, canceled 0, ignored 0, pending 1   (the 
pending one is pre-existing)

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

Smoke run: the generated code was executed outside Texera (pytexera
stubbed, pandas + plotly 5.24.1) on the 430-gene mock table. Defaults
give title `Volcano Plot`, x `lfc_shrunk`, y `-log10(padj)`, color bar
`lfc_shrunk`; with the labels set the figure shows the typed text;
whitespace-only title and y label fall back to the defaults. The
exported script for the default and the all-labels 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/43796782151

With regards,
GitHub Actions via GitBox

Reply via email to