BryanCutler commented on a change in pull request #24306:
[SPARK-27387][PYTHON][TESTS] Replace sqlutils.assertPandasEqual with Pandas
assert_frame_equals
URL: https://github.com/apache/spark/pull/24306#discussion_r273585669
##########
File path: python/pyspark/sql/tests/test_pandas_udf_grouped_map.py
##########
@@ -29,6 +29,25 @@
pandas_requirement_message, pyarrow_requirement_message
from pyspark.testing.utils import QuietTest
+if have_pandas:
+ import pandas as pd
+ from pandas.util.testing import assert_frame_equal as pd_assert_frame_equal
+
+if have_pyarrow:
+ import pyarrow as pa
+
+
+def assert_frame_equal(left, right):
+ """
+ Wrap Pandas function because pd.DataFrame.assign will infer mixed types
(unicode/str)
+ w/ Python 2, so need to set check_column_type=False
+ """
+ import sys
+ if sys.version < '3':
+ pd_assert_frame_equal(left, right, check_column_type=False)
Review comment:
I don't know, the problem only comes up in these tests because of the way
they call `assign`. How about I remove this function wrapping and just make the
option conditional for Python version?
----------------------------------------------------------------
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.
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]