Skip to content

Commit 6279449

Browse files
committed
TST: Do not allow inplace operations on indexes that require type promotion.
1 parent 21c44fd commit 6279449

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/test_index.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,12 @@ def test_coerce_list(self):
20782078
def test_dtype(self):
20792079
self.assertEqual(self.index.dtype, np.int64)
20802080

2081+
def test_promote_type_inplace(self):
2082+
# Related to GH-9966
2083+
index = Int64Index(np.arange(5))
2084+
with self.assertRaises(TypeError):
2085+
index *= 0.333
2086+
20812087
def test_is_monotonic(self):
20822088
self.assertTrue(self.index.is_monotonic)
20832089
self.assertTrue(self.index.is_monotonic_increasing)

0 commit comments

Comments
 (0)