You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by GitBox <gi...@apache.org> on 2026/07/23 04:26:38 UTC
[GH] (texera/gh-readonly-queue/main/pr-6807-6495ebd84ab0dc7f4f6b1d4fbc09ff051f4cfd10): Workflow run "Required Checks" is working again!
The GitHub Actions job "Required Checks" on texera.git/gh-readonly-queue/main/pr-6807-6495ebd84ab0dc7f4f6b1d4fbc09ff051f4cfd10 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).
Head commit for run:
c24755c98e0d17b07712ee677ee9ddd7d33ccb68 / Kary Zheng <15...@users.noreply.github.com>
fix(BarChart): treat an empty categoryColumn as no category (px.bar color) (#6807)
### What changes were proposed in this PR?
Fixes `BarChartOpDesc.generatePythonCode` treating an **unset**
`categoryColumn` as a real column, which breaks `px.bar` at runtime.
`categoryColumn`'s Scala field default is the empty string, while its
JSON `defaultValue = "No Selection"` is only schema metadata (not
applied to the Scala var, and not present when the field is absent from
the deserialized JSON). The category guard compared **only** against
`"No Selection"`:
```scala
var isCategoryColumn = "False"
if (categoryColumn != "No Selection") // "" != "No Selection" is true
isCategoryColumn = "True"
```
So for an empty `categoryColumn`, `isCategoryColumn` became `"True"` and
the empty column name flowed into the generated call:
```python
color=self.decode_python_template('') if True else None # -> px.bar(color="")
```
`px.bar(color="")` raises at runtime, so a bar chart with **no category
selected** fails.
The fix also guards against empty, so an unset category yields
`color=None`:
```diff
- if (categoryColumn != "No Selection")
+ if (categoryColumn.nonEmpty && categoryColumn != "No Selection")
```
### Any related issues, documentation, discussions?
Closes #6792
### How was this PR tested?
Added a regression test in `BarChartOpDescSpec` that constructs a
`BarChartOpDesc` with `value`/`fields` set and `categoryColumn` left at
its default, calls `generatePythonCode()`, and asserts the color site is
guarded to `None` (`... if False else None`) with no `... if True else
None`. Verified the test **fails** on the pre-fix code and **passes**
with the fix; full `BarChartOpDescSpec` is green (9/9).
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)
---------
Signed-off-by: Kary Zheng <15...@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <no...@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <17...@users.noreply.github.com>
Report URL: https://github.com/apache/texera/actions/runs/29978351560
With regards,
GitHub Actions via GitBox