Tian Gao created SPARK-61828:
--------------------------------

             Summary: Add observation test for more metric value types
                 Key: SPARK-61828
                 URL: https://issues.apache.org/jira/browse/SPARK-61828
             Project: Spark
          Issue Type: Test
          Components: PySpark
    Affects Versions: 5.0.0
            Reporter: Tian Gao


15 lines of `LiteralExpression._to_value` in 
`python/pyspark/sql/connect/expressions.py` were not covered by any test. This 
method converts the proto literals that the Connect server returns for observed 
metrics into Python values. The existing observation tests only use long and 
double values plus a top-level struct, array, and map, so the null, byte, 
short, float, and timestamp_ntz branches and the type checks for a struct or 
map nested inside a struct never ran. This test covers 14 of those 15 lines. 
The remaining line is the `UNSUPPORTED_LITERAL` error branch, which cannot be 
reached through public APIs.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to