fix: add quotes around enum string values in visualization operators#4351
fix: add quotes around enum string values in visualization operators#4351Xiao-zhen-Liu merged 11 commits intoapache:mainfrom
Conversation
|
Can we add test cases to catch this problem? |
Discussed this with @carloea2, please correct me if I missed anything. We already have PythonCodeRawInvalidTextSpec, which runs py_compile on all generated operator code, but it can't catch this bug. mode=lines is syntactically valid Python, so it only fails at runtime with a NameError. A test that would catch this issue would need to execute the generated code with real data and Plotly imported. I'm not sure the added test complexity is worth it right now. Could we merge this first to unblock the broken operators, and then follow up with a more meaningful integration test if needed? |
|
@carloea2 Please chime in and review it. After that, @Xiao-zhen-Liu can review it. |
|
LGTM. I think executing the operators in the specs to catch runtime errors can be a big improvement but requires careful consideration and this PR should not be blocked by that. Thanks. I hope this PR can be merged soon. |
|
Can we merge it? |
|
I will do the merge after test cases pass. |
What changes were proposed in this PR?
This PR adds quotes around plain String values returned by Java enum methods in three visualization operators so the generated Python code is valid:
Any related issues, documentation, discussions?
Related to #4189
Resolves #4350
How was this PR tested?
Existing tests passed
Was this PR authored or co-authored using generative AI tooling?
No