kz930 commented on code in PR #7233:
URL: https://github.com/apache/texera/pull/7233#discussion_r3716593694


##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/gaugeChart/GaugeChartOpDesc.scala:
##########
@@ -69,21 +72,26 @@ class GaugeChartOpDesc extends PythonOperatorDescriptor {
       OperatorGroupConstants.VISUALIZATION_FINANCIAL_GROUP
     )
 
-  private val mapper = new ObjectMapper()
-  mapper.registerModule(DefaultScalaModule)
+  /** An unset number reaches the generated code as Python's `None`. */
+  private def numberOrNone(value: Option[Double]): PythonLiteral =
+    value.map(_.toString).getOrElse("None")
 
-  private def serializeSteps(steps: List[GaugeChartSteps]): String = {
-    mapper.writeValueAsString(steps)
-  }
+  /** The steps whose bounds are both filled in, as a list literal of numbers. 
*/
+  private def stepsLiteral: PythonLiteral =
+    steps

Review Comment:
   Normalized — `stepsLiteral` now reads a null list as no steps, the same 
`Option(steps)` shape Bullet Chart uses. The new Gauge Chart case deserializes 
`{"operatorType": "GaugeChart", "value": "score", "steps": null}`, asserts the 
field really arrives null, and asserts the generated code carries `valid_steps 
= []`; reverting the normalization fails it with the NullPointerException you 
describe. Bullet Chart gets the same case, since its normalization had no test 
behind it.



-- 
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]

Reply via email to