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


##########
python/pyspark/pandas/utils.py:
##########
@@ -919,7 +917,13 @@ def verify_temp_column_name(
         )
         column_name = column_name_or_label
 
-    assert isinstance(df, (PySparkDataFrame, ConnectDataFrame)), type(df)
+    if is_remote():
+        from pyspark.sql.connect.dataframe import DataFrame as ConnectDataFrame
+
+        SparkDataFrame = ConnectDataFrame
+    else:
+        SparkDataFrame = PySparkDataFrame  # type: ignore[assignment]

Review Comment:
   I think we need this because `assert isinstance(df, SparkDataFrame)` would 
fail when `is_remote` returns `False`? Because `SparkDataFrame` will not be 
defined in that case.



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