We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5d6834 commit b4cbc19Copy full SHA for b4cbc19
pandas/tests/arrays/test_array.py
@@ -291,7 +291,7 @@ class DecimalArray2(DecimalArray):
291
@classmethod
292
def _from_sequence(cls, scalars, dtype=None, copy=False):
293
if isinstance(scalars, (pd.Series, pd.Index)):
294
- raise TypeError
+ raise TypeError("scalars should not be of type pd.Series or pd.Index")
295
296
return super()._from_sequence(scalars, dtype=dtype, copy=copy)
297
@@ -301,7 +301,9 @@ def test_array_unboxes(index_or_series):
301
302
data = box([decimal.Decimal("1"), decimal.Decimal("2")])
303
# make sure it works
304
- with pytest.raises(TypeError):
+ with pytest.raises(
305
+ TypeError, match="scalars should not be of type pd.Series or pd.Index"
306
+ ):
307
DecimalArray2._from_sequence(data)
308
309
result = pd.array(data, dtype="decimal2")
0 commit comments