We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb7a8c8 commit 4f080b8Copy full SHA for 4f080b8
pandas/io/parsers/arrow_parser_wrapper.py
@@ -295,7 +295,15 @@ def read(self) -> DataFrame:
295
dtype_mapping[pa.null()] = pd.Int64Dtype()
296
frame = table.to_pandas(types_mapper=dtype_mapping.get)
297
elif using_pyarrow_string_dtype():
298
- frame = table.to_pandas(types_mapper=arrow_string_types_mapper())
+
299
+ def types_mapper(dtype):
300
+ dtype_dict = self.kwds["dtype"]
301
+ if dtype_dict is not None and dtype_dict.get(dtype, None) is not None:
302
+ return dtype_dict.get(dtype)
303
+ return arrow_string_types_mapper()(dtype)
304
305
+ frame = table.to_pandas(types_mapper=types_mapper)
306
307
else:
308
if isinstance(self.kwds.get("dtype"), dict):
309
frame = table.to_pandas(types_mapper=self.kwds["dtype"].get)
0 commit comments