Skip to content

Commit

Permalink
Fix test_indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
itholic committed Apr 16, 2021
1 parent 0fc0e0a commit 8859f79
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions python/pyspark/pandas/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ def test_frame_iloc_setitem(self):
kdf.iloc[0, 1] = 50
self.assert_eq(kdf, pdf)

with self.assertRaisesRegex(ValueError, "Incompatible indexer with Series"):
with self.assertRaisesRegex(ValueError, "setting an array element with a sequence."):
kdf.iloc[0, 0] = -kdf.max_speed
with self.assertRaisesRegex(ValueError, "shape mismatch"):
kdf.iloc[:, [1, 0]] = -kdf.max_speed
Expand Down Expand Up @@ -1227,14 +1227,7 @@ def test_series_iloc_setitem(self):
self.assert_eq(kser, pser)
self.assert_eq(kdf, pdf)

# TODO: matching the behavior with pandas 1.2 and uncomment below test.
# with self.assertRaisesRegex(
# ValueError,
# "cannot set using a list-like indexer with a different length than the value",
# ):
# kser.iloc[[1]] = -kdf.b

with self.assertRaisesRegex(ValueError, "Incompatible indexer with DataFrame"):
with self.assertRaisesRegex(ValueError, "setting an array element with a sequence."):
kser.iloc[1] = kdf[["b"]]

def test_iloc_raises(self):
Expand Down

0 comments on commit 8859f79

Please sign in to comment.