diff --git a/pandas/core/series.py b/pandas/core/series.py index 6a2a30a3efa17..023819518dc00 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1138,7 +1138,6 @@ def _set_value(self, label, value, takeable: bool = False): else: self.index._engine.set_value(self._values, label, value) except (KeyError, TypeError): - # set using a non-recursive method self.loc[label] = value diff --git a/pandas/tests/dtypes/test_common.py b/pandas/tests/dtypes/test_common.py index 097e83d93ee71..4c917b9bb42d2 100644 --- a/pandas/tests/dtypes/test_common.py +++ b/pandas/tests/dtypes/test_common.py @@ -675,6 +675,8 @@ def test__get_dtype(input_param, result): ) def test__get_dtype_fails(input_param, expected_error_message): # python objects + # 2020-02-02 npdev changed error message + expected_error_message += f"|Cannot interpret '{input_param}' as a data type" with pytest.raises(TypeError, match=expected_error_message): com._get_dtype(input_param) diff --git a/pandas/tests/dtypes/test_dtypes.py b/pandas/tests/dtypes/test_dtypes.py index fddd6239df309..4475be12f3ff8 100644 --- a/pandas/tests/dtypes/test_dtypes.py +++ b/pandas/tests/dtypes/test_dtypes.py @@ -43,7 +43,12 @@ def test_equality_invalid(self): assert not is_dtype_equal(self.dtype, np.int64) def test_numpy_informed(self): - with pytest.raises(TypeError, match="data type not understood"): + # npdev 2020-02-02 changed from "data type not understood" to + # "Cannot interpret 'foo' as a data type" + msg = "|".join( + ["data type not understood", "Cannot interpret '.*' as a data type"] + ) + with pytest.raises(TypeError, match=msg): np.dtype(self.dtype) assert not self.dtype == np.str_