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


##########
python/pyspark/pandas/data_type_ops/num_ops.py:
##########
@@ -213,37 +215,43 @@ def abs(self, operand: IndexOpsLike) -> IndexOpsLike:
             F.abs(operand.spark.column), field=operand._internal.data_fields[0]
         )
 
+    def eq(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
+        # We can directly use `super().eq` when given object is list, tuple, 
dict or set.
+        if not isinstance(right, IndexOpsMixin) and is_list_like(right):
+            return super().eq(left, right)
+        if _is_extension_dtypes(left) or _is_extension_dtypes(right):
+            return pyspark_column_op("__eq__", left, right)
+        return pyspark_column_op("__eq__", left, right, fillna=False)
+
+    def ne(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
+        _sanitize_list_like(right)
+        if _is_extension_dtypes(left) or _is_extension_dtypes(right):
+            return pyspark_column_op("__ne__", left, right)
+        return pyspark_column_op("__ne__", left, right, fillna=True)
+
     def lt(self, left: IndexOpsLike, right: Any) -> SeriesOrIndex:
         _sanitize_list_like(right)
-        result = pyspark_column_op("__lt__")(left, right)
-        if is_remote():
-            # TODO(SPARK-43877): Fix behavior difference for compare binary 
functions.
-            result = result.fillna(False)
-        return result
+        if _is_extension_dtypes(left) or _is_extension_dtypes(right):
+            return pyspark_column_op("__lt__", left, right)
+        return pyspark_column_op("__lt__", left, right, fillna=False)

Review Comment:
   I think you can put `_is_extension_dtypes(left) or 
_is_extension_dtypes(right)` condition to `fillna`?



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