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


##########
python/pyspark/pandas/data_type_ops/boolean_ops.py:
##########
@@ -355,8 +402,15 @@ def pretty_name(self) -> str:
     def __and__(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
         _sanitize_list_like(right)
 
-        def and_func(left: GenericColumn, right: Any) -> GenericColumn:
-            if not isinstance(right, (Column, ConnectColumn)):
+        if is_remote():
+            from pyspark.sql.connect.column import Column as ConnectColumn
+
+            Column = ConnectColumn
+        else:
+            Column = PySparkColumn  # type: ignore[assignment]
+
+        def and_func(left: Column, right: Any) -> Column:  # type: 
ignore[valid-type]
+            if not isinstance(right, Column):

Review Comment:
   ditto remove



##########
python/pyspark/pandas/data_type_ops/boolean_ops.py:
##########
@@ -368,8 +422,15 @@ def and_func(left: GenericColumn, right: Any) -> 
GenericColumn:
     def __or__(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
         _sanitize_list_like(right)
 
-        def or_func(left: GenericColumn, right: Any) -> GenericColumn:
-            if not isinstance(right, (Column, ConnectColumn)):
+        if is_remote():
+            from pyspark.sql.connect.column import Column as ConnectColumn
+
+            Column = ConnectColumn
+        else:
+            Column = PySparkColumn  # type: ignore[assignment]
+
+        def or_func(left: Column, right: Any) -> Column:  # type: 
ignore[valid-type]
+            if not isinstance(right, Column):

Review Comment:
   ditto remove.



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