File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ class DecimalArray2(DecimalArray):
291
291
@classmethod
292
292
def _from_sequence (cls , scalars , dtype = None , copy = False ):
293
293
if isinstance (scalars , (pd .Series , pd .Index )):
294
- raise TypeError
294
+ raise TypeError ( "scalars should not be of type pd.Series or pd.Index" )
295
295
296
296
return super ()._from_sequence (scalars , dtype = dtype , copy = copy )
297
297
@@ -301,7 +301,9 @@ def test_array_unboxes(index_or_series):
301
301
302
302
data = box ([decimal .Decimal ("1" ), decimal .Decimal ("2" )])
303
303
# make sure it works
304
- with pytest .raises (TypeError ):
304
+ with pytest .raises (
305
+ TypeError , match = "scalars should not be of type pd.Series or pd.Index"
306
+ ):
305
307
DecimalArray2 ._from_sequence (data )
306
308
307
309
result = pd .array (data , dtype = "decimal2" )
You can’t perform that action at this time.
0 commit comments