Skip to content

Commit 4bb986a

Browse files
make error message consistent
1 parent e586859 commit 4bb986a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/arrays/string_arrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _maybe_convert_setitem_value(self, value):
240240
value[isna(value)] = None
241241
for v in value:
242242
if not (v is None or isinstance(v, str)):
243-
raise TypeError("Scalar must be NA or str")
243+
raise TypeError("Must provide strings")
244244
return super()._maybe_convert_setitem_value(value)
245245

246246
def isin(self, values: ArrayLike) -> npt.NDArray[np.bool_]:

pandas/tests/indexing/test_loc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ def test_loc_setitem_str_to_small_float_conversion_type(self, using_infer_string
12301230
# assigning with loc/iloc attempts to set the values inplace, which
12311231
# in this case is successful
12321232
if using_infer_string:
1233-
with pytest.raises(TypeError, match="Scalar must"):
1233+
with pytest.raises(TypeError, match="Must provide strings"):
12341234
result.loc[result.index, "A"] = [float(x) for x in col_data]
12351235
else:
12361236
result.loc[result.index, "A"] = [float(x) for x in col_data]

0 commit comments

Comments
 (0)