Skip to content

Commit

Permalink
Fix behavior & test
Browse files Browse the repository at this point in the history
  • Loading branch information
itholic committed Aug 2, 2023
1 parent c4fe7ad commit fd8d741
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/pyspark/pandas/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,7 @@ def difference(self, other: "Index", sort: Optional[bool] = None) -> "Index":
# Check if the `self` and `other` have different index types.
# 1. `self` is Index, `other` is MultiIndex
# 2. `self` is MultiIndex, `other` is Index
is_index_types_different = isinstance(other, Index) and not isinstance(self, type(other))
is_index_types_different = isinstance(other, Index) and (type(self) != type(other))
if is_index_types_different:
if isinstance(self, MultiIndex):
# In case `self` is MultiIndex and `other` is Index,
Expand Down
3 changes: 2 additions & 1 deletion python/pyspark/pandas/tests/series/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,8 @@ def test_dot(self):

psdf_other = ps.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}, index=["x", "y", "z"])
with self.assertRaisesRegex(ValueError, "matrices are not aligned"):
psdf["b"].dot(psdf_other)
with ps.option_context("compute.ops_on_diff_frames", True):
psdf["b"].dot(psdf_other)

def test_tail(self):
pser = pd.Series(range(1000), name="Koalas")
Expand Down

0 comments on commit fd8d741

Please sign in to comment.