HyukjinKwon commented on code in PR #42332:
URL: https://github.com/apache/spark/pull/42332#discussion_r1286452469


##########
python/pyspark/testing/utils.py:
##########
@@ -464,23 +467,42 @@ def assertDataFrameEqual(
         raise PySparkAssertionError(
             error_class="INVALID_TYPE_DF_EQUALITY_ARG",
             message_parameters={
-                "expected_type": Union[DataFrame, ps.DataFrame, List[Row]],
+                "expected_type": "Union[DataFrame, ps.DataFrame, List[Row]]",
                 "arg_name": "expected",
                 "actual_type": None,
             },
         )
 
+    has_pandas = False
     try:
-        # If Spark Connect dependencies are available, allow Spark Connect 
DataFrame
-        from pyspark.sql.connect.dataframe import DataFrame as ConnectDataFrame
+        # If pandas dependencies are available, allow pandas or 
pandas-on-Spark DataFrame
+        import pyspark.pandas as ps
+        import pandas as pd
+        from pyspark.testing.pandasutils import PandasOnSparkTestUtils
 
-        if isinstance(actual, ps.DataFrame) or isinstance(expected, 
ps.DataFrame):
+        has_pandas = True
+    except Exception:

Review Comment:
   except ImportError?



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to