viirya commented on a change in pull request #22807: [SPARK-25811][PySpark]
Raise a proper error when unsafe cast is detected by PyArrow
URL: https://github.com/apache/spark/pull/22807#discussion_r249791095
##########
File path: python/pyspark/sql/tests/test_pandas_udf.py
##########
@@ -197,6 +197,64 @@ def foofoo(x, y):
).collect
)
+ def test_pandas_udf_detect_unsafe_type_conversion(self):
+ from distutils.version import LooseVersion
+ import pandas as pd
+ import numpy as np
+ import pyarrow as pa
+
+ values = [1.0] * 3
+ pdf = pd.DataFrame({'A': values})
+ df = self.spark.createDataFrame(pdf).repartition(1)
Review comment:
I thought I was writing this to make sure all values are in single partition
so it matches the length of returned Pandas Series. This can be simplified. We
can do this if we touch the code here next time.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]