Skip to content

Commit 7aa640d

Browse files
committed
mypy fixup, error message compat for 32bit builds
1 parent 98bedc4 commit 7aa640d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pandas/io/parsers/arrow_parser_wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ def read(self) -> DataFrame:
330330
# We cast here in case the user passed "category" in
331331
# order to get the correct dtype.categories.dtype
332332
# e.g. test_categorical_dtype_utf16
333-
new_dtype[key] = StringDtype(na_value=np.nan)
333+
sdt = StringDtype(na_value=np.nan)
334+
new_dtype[key] = sdt # type: ignore[assignment]
334335
frame[key] = frame[key].astype(new_dtype[key])
335336

336337
new_dtype.update(old_dtype)

pandas/tests/io/parser/test_na_values.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ def test_bool_and_nan_to_int(all_parsers):
802802
False
803803
"""
804804
msg = (
805-
"cannot safely convert passed user dtype of int64 for "
805+
"cannot safely convert passed user dtype of int(64|32) for "
806806
"<class 'numpy.bool'> dtyped data in column 0 due to NA values"
807807
)
808808
if parser.engine == "python":
809-
msg = "Unable to convert column 0 to type int64"
809+
msg = "Unable to convert column 0 to type int(64|32)"
810810
elif parser.engine == "pyarrow":
811811
msg = r"cannot convert NA to integer"
812812
with pytest.raises(ValueError, match=msg):

0 commit comments

Comments
 (0)