urosstan-db commented on PR #59466:
URL: https://github.com/apache/spark/pull/59466#issuecomment-6193824262

   > Thank you for the followups! One issue left in the observe grid 
(MiscFunctionsSuite):
   > 
   > ```scala
   > val expected = if (functionName == "vector_sum") Seq(28.0, 8.0) else 
Seq(3.5, 1.0)
   > assertResult(Map("value" -> expected))(observation.get)
   > ```
   > 
   > Observation.get returns Seq[Float] for ARRAY and Seq[Double] for ARRAY. 
The expected value is always Seq[Double], so the float vector_sum and 
vector_avg cases will fail. Compare via .doubleValue() (or use float literals 
on the float rows). The double vector_sum case is fine.
   
   Thanks for checking! These cases pass: Scala's == on boxed numbers compares 
by value (28.0f == 28.0 is true), and Seq/Map equality and assertResult use it, 
so Seq(28.0f, 8.0f) == Seq(28.0, 8.0).
   All expected values are exactly representable as floats. I can make the 
expected values typed per element type if you think that reads clearer.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to