Copilot commented on code in PR #6807:
URL: https://github.com/apache/texera/pull/6807#discussion_r3634973119
##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/barChart/BarChartOpDescSpec.scala:
##########
@@ -110,4 +110,14 @@ class BarChartOpDescSpec extends AnyFlatSpec with
BeforeAndAfter with Matchers {
ex.getMessage should (include("Value column") or include("Fields"))
}
+ "BarChartOpDesc.generatePythonCode" should "treat an unset categoryColumn as
no category (color guarded to None)" in {
+ // An empty categoryColumn (its Scala default) must guard color to None,
not
+ // emit `... if True else None` with an empty column name for
px.bar(color=).
+ opDesc.value = "score"
+ opDesc.fields = "name"
+ val code = opDesc.generatePythonCode()
+ code should include("if False else None")
+ code should not include "if True else None"
+ }
Review Comment:
The assertions here are overly broad: `code should not include "if True else
None"` will fail if any other optional argument becomes enabled (e.g., future
defaults or additional conditionals), even when the category-column guarding is
correct. It’s more robust to assert specifically on the `color=...` site(s).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]