This is an automated email from the ASF dual-hosted git repository.
Xiao-zhen-Liu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new 0316204fc2 fix: add quotes around enum string values in visualization
operators (#4351)
0316204fc2 is described below
commit 0316204fc28db3a8973180c690462683f2f43f56
Author: Xuan Gu <[email protected]>
AuthorDate: Wed Apr 22 22:58:16 2026 -0700
fix: add quotes around enum string values in visualization operators (#4351)
<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
2. Ensure you have added or run the appropriate tests for your PR
3. If the PR is work in progress, mark it a draft on GitHub.
4. Please write your PR title to summarize what this PR proposes, we
are following Conventional Commits style for PR titles as well.
5. Be sure to keep the PR description updated to reflect all changes.
-->
### What changes were proposed in this PR?
<!--
Please clarify what changes you are proposing. The purpose of this
section
is to outline the changes. Here are some tips for you:
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
3. If it is a refactoring, clarify what has been changed.
3. It would be helpful to include a before-and-after comparison using
screenshots or GIFs.
4. Please consider writing useful notes for better and faster reviews.
-->
This PR adds quotes around plain String values returned by Java enum
methods in three visualization operators so the generated Python code is
valid:
- ContinuousErrorBands: mode='${bandConf.mode.getModeInPlotly}'
- ContourPlot: contours_coloring='${coloringMethod.getColoringMethod}'
- Histogram2D: histnorm='${normalize.getValue}'
### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned
already.
1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves
#1234`
or `Closes #1234`. If it is only related, simply mention the issue
number.
2. If there is design documentation, please add the link.
3. If there is a discussion in the mailing list, please add the link.
-->
Related to #4189
Resolves #4350
### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if
the PR
is tested with existing test cases. Make sure to include/update test
cases that
check the changes thoroughly including negative and positive cases if
possible.
If it was tested in a way different from regular unit tests, please
clarify how
you tested step by step, ideally copy and paste-able, so that other
reviewers can
test and check, and descendants can verify in the future. If tests were
not added,
please describe why they were not added and/or why it was difficult to
add.
-->
Existing tests passed
### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'.
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
No
---------
Co-authored-by: Yicong Huang
<[email protected]>
Co-authored-by: Chen Li <[email protected]>
Co-authored-by: Xiaozhen Liu <[email protected]>
---
.../amber/operator/source/apis/reddit/RedditSearchSourceOpDesc.scala | 2 +-
.../visualization/continuousErrorBands/ContinuousErrorBandsOpDesc.scala | 2 +-
.../amber/operator/visualization/contourPlot/ContourPlotOpDesc.scala | 2 +-
.../amber/operator/visualization/histogram2d/Histogram2DOpDesc.scala | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/apis/reddit/RedditSearchSourceOpDesc.scala
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/apis/reddit/RedditSearchSourceOpDesc.scala
index 85cf30bf06..078e55b2b2 100644
---
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/apis/reddit/RedditSearchSourceOpDesc.scala
+++
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/apis/reddit/RedditSearchSourceOpDesc.scala
@@ -68,7 +68,7 @@ class RedditSearchSourceOpDesc extends
PythonSourceOperatorDescriptor {
| client_secret = $clientSecretReal
| limit = $limit
| query = $queryReal
- | sorting = ${sorting.getName}
+ | sorting = '${sorting.getName}'
|
| @overrides
| def produce(self) -> Iterator[Union[TupleLike, TableLike, None]]:
diff --git
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDesc.scala
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDesc.scala
index 56b25a724f..e121f6fc21 100644
---
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDesc.scala
+++
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDesc.scala
@@ -106,7 +106,7 @@ class ContinuousErrorBandsOpDesc extends
PythonOperatorDescriptor {
fig.add_trace(go.Scatter(
x=table[${bandConf.xValue}],
y=table[${bandConf.yValue}],
- mode=${bandConf.mode.getModeInPlotly},
+ mode='${bandConf.mode.getModeInPlotly}',
$colorPart
$namePart
))"""
diff --git
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/contourPlot/ContourPlotOpDesc.scala
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/contourPlot/ContourPlotOpDesc.scala
index 928ce01c44..fb41ecfedb 100644
---
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/contourPlot/ContourPlotOpDesc.scala
+++
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/contourPlot/ContourPlotOpDesc.scala
@@ -107,7 +107,7 @@ class ContourPlotOpDesc extends PythonOperatorDescriptor {
| y=np.linspace(min(y), max(y), grid_size),
| z=grid_z,
| connectgaps=connGaps,
- | contours_coloring =${coloringMethod.getColoringMethod},
+ | contours_coloring ='${coloringMethod.getColoringMethod}',
| colorbar_title=$z
| ))
| fig.update_layout(title='Contour Plot')
diff --git
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/histogram2d/Histogram2DOpDesc.scala
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/histogram2d/Histogram2DOpDesc.scala
index 117ab62d38..34dbc56d59 100644
---
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/histogram2d/Histogram2DOpDesc.scala
+++
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/histogram2d/Histogram2DOpDesc.scala
@@ -78,7 +78,7 @@ class Histogram2DOpDesc extends PythonOperatorDescriptor {
assert(yBins > 0, s"Y Bins must be > 0, but got $yBins")
val normArg =
- pyb"histnorm=${normalize.getValue},"
+ pyb"histnorm='${normalize.getValue}',"
pyb"""
|from pytexera import *