xinrong-meng commented on code in PR #37234:
URL: https://github.com/apache/spark/pull/37234#discussion_r926917441
##########
python/pyspark/pandas/typedef/typehints.py:
##########
@@ -357,7 +359,18 @@ def infer_pd_series_spark_type(
elif hasattr(pser.iloc[0], "__UDT__"):
return pser.iloc[0].__UDT__
else:
- return from_arrow_type(pa.Array.from_pandas(pser).type,
prefer_timestamp_ntz)
+ try:
+ internal_frame = pa.Array.from_pandas(pser)
+ except (pa.lib.ArrowInvalid, pa.lib.ArrowTypeError):
Review Comment:
Then how about we adjust the error message to be proper for all cases
mentioned? That's my ask
[here](https://github.com/apache/spark/pull/37234#issuecomment-1190974458) :)
--
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]