We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8cbac01 commit 124cb9fCopy full SHA for 124cb9f
pandas/io/parsers/arrow_parser_wrapper.py
@@ -267,7 +267,15 @@ def read(self) -> DataFrame:
267
dtype_mapping[pa.null()] = pd.Int64Dtype()
268
frame = table.to_pandas(types_mapper=dtype_mapping.get)
269
elif using_pyarrow_string_dtype():
270
- frame = table.to_pandas(types_mapper=arrow_string_types_mapper())
+
271
+ def types_mapper(dtype):
272
+ dtype_dict = self.kwds["dtype"]
273
+ if dtype_dict is not None and dtype_dict.get(dtype, None) is not None:
274
+ return dtype_dict.get(dtype)
275
+ return arrow_string_types_mapper()(dtype)
276
277
+ frame = table.to_pandas(types_mapper=types_mapper)
278
279
else:
280
if isinstance(self.kwds.get("dtype"), dict):
281
frame = table.to_pandas(types_mapper=self.kwds["dtype"].get)
0 commit comments