From 8859f79630131126af082b93b3db58d96ddafacc Mon Sep 17 00:00:00 2001 From: itholic Date: Fri, 16 Apr 2021 10:00:53 +0900 Subject: [PATCH] Fix test_indexing --- python/pyspark/pandas/tests/test_indexing.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/python/pyspark/pandas/tests/test_indexing.py b/python/pyspark/pandas/tests/test_indexing.py index 89647c7fb6748..8298767f673d3 100644 --- a/python/pyspark/pandas/tests/test_indexing.py +++ b/python/pyspark/pandas/tests/test_indexing.py @@ -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 @@ -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):