Skip to content

fix: convert BubbleChart boolean field to Python-compatible value#4238

Open
xuang7 wants to merge 5 commits intoapache:mainfrom
xuang7:fix/bubble-chart-boolean-python-conversion
Open

fix: convert BubbleChart boolean field to Python-compatible value#4238
xuang7 wants to merge 5 commits intoapache:mainfrom
xuang7:fix/bubble-chart-boolean-python-conversion

Conversation

@xuang7
Copy link
Contributor

@xuang7 xuang7 commented Feb 25, 2026

What changes were proposed in this PR?

This PR adds an explicit boolean conversion in BubbleChartOpDesc. It fixes an issue where the Scala boolean field enableColor was rendered in the new Python template as lowercase true/false instead of True/False. This caused a runtime error: NameError: name 'false' is not defined.

Demo:
bubblechart

Any related issues, documentation, discussions?

No

How was this PR tested?

Manually tested

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

No

@carloea2
Copy link
Contributor

I think the best solution is to keep the previous semantics but fixing it.
A simpler solution may be just if $enableColor == 'true': -> if '$enableColor' == 'true':
@xuang7

isColorEnabled = "True"

pyb"""
| if $enableColor == 'true':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just if '$enableColor' == 'true':?

Copy link
Contributor Author

@xuang7 xuang7 Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I chose this approach to stay consistent with how other operator's boolean values are handled. Since the original code already uses the string comparison style, We could go with the one-line fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants