Vamsi-klu commented on code in PR #58039:
URL: https://github.com/apache/spark/pull/58039#discussion_r3803159439


##########
python/pyspark/sql/pandas/types.py:
##########
@@ -75,6 +75,8 @@
 
 # Should keep in line with org.apache.spark.sql.util.ArrowUtils.metadataKey
 metadata_key = b"SPARK::metadata::json"
+# Keep in line with org.apache.spark.sql.util.ArrowUtils.timePrecisionKey
+time_precision_key = b"SPARK::time::precision"

Review Comment:
   Yes, those paths all go through the same SPARK::time::precision field 
metadata. I added e2e tests for them:
   
   - createDataFrame / collect / toArrow / toPandas: 
`test_time_precision_e2e_createDataFrame_collect` (Connect via ArrowParityTests)
   - Python UDF (Arrow and pickled): `test_time_precision_python_udf`
   - scalar arrow_udf: `test_arrow_udf_time_precision`
   - mapInArrow: `test_time_precision_map_in_arrow`
   
   For p in {0, 3, 6, 9} the schema stays TIME(p) and collect matches. Untagged 
time64 still falls back to TIME(6).



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