itholic commented on code in PR #44899:
URL: https://github.com/apache/spark/pull/44899#discussion_r1467391496


##########
python/pyspark/testing/utils.py:
##########
@@ -758,11 +758,14 @@ def assertDataFrameEqual(
     has_pandas = False
     try:
         # 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
 
         has_pandas = True
+        if has_pandas:
+            # Only import pyspark.pandas when Pandas is available to prevent 
test stopping
+            # when Pandas is not installed.
+            import pyspark.pandas as ps

Review Comment:
   relocated the import



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