You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/13 08:03:26 UTC

[GitHub] [spark] dchvn commented on a change in pull request #34235: [SPARK-36968][PYTHON] ps.Series.dot raise "matrices are not aligned" if index is not same

dchvn commented on a change in pull request #34235:
URL: https://github.com/apache/spark/pull/34235#discussion_r727802685



##########
File path: python/pyspark/pandas/series.py
##########
@@ -5014,11 +4998,11 @@ def dot(self, other: Union["Series", DataFrame]) -> Union[Scalar, "Series"]:
         y   -14
         dtype: int64
         """
-        if isinstance(other, DataFrame):
-            if not same_anchor(self, other):
-                if not self.index.sort_values().equals(other.index.sort_values()):
-                    raise ValueError("matrices are not aligned")
+        if not same_anchor(self, other):
+            if not self.index.sort_values().equals(other.index.sort_values()):

Review comment:
       I would like to add another parameter like ```check_index```
   ``` python
   def dot(self, other: Union["Series", DataFrame], check_index: bool = True) -> Union[Scalar, "Series"]:
   ```
   ```True```: behave like pandas
   ```False```: ignore mismatches with NaN
   What do you think ?




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org