HyukjinKwon commented on a change in pull request #34750:
URL: https://github.com/apache/spark/pull/34750#discussion_r759803932



##########
File path: python/pyspark/pandas/series.py
##########
@@ -5847,7 +5866,9 @@ def compare(
                 )
             )
         else:
-            if not self.index.equals(other.index):
+            if get_option("compute.eager_check") and not 
self.index.equals(other.index):
+                raise ValueError("Can only compare identically-labeled Series 
objects")
+            elif len(self.index) != len(other.index):

Review comment:
       you can change the condition as below btw:
   
   ```python
   if ((get_option("compute.eager_check") and not 
self.index.equals(other.index)) or
          # Length checks are required even when 'compute.eager_check' is off 
because ...
          (len(self.index) != len(other.index)))
   ```




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