Skip to content

Commit

Permalink
Moved dtype setting function to finalize output function
Browse files Browse the repository at this point in the history
  • Loading branch information
wshaoul committed Oct 5, 2024
1 parent 9c3a2fb commit 2ea84ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/io/parsers/arrow_parser_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ def _finalize_pandas_output(self, frame: DataFrame) -> DataFrame:
except TypeError as err:
# GH#44901 reraise to keep api consistent
raise ValueError(str(err)) from err

self._set_date_column_dtype(frame, date_columns=["date_column1", "date_column2"], dtype="timestamp[ns][pyarrow]")

return frame

def _validate_usecols(self, usecols) -> None:
Expand Down Expand Up @@ -306,8 +309,6 @@ def read(self) -> DataFrame:

else:
frame = table.to_pandas()

self._set_date_column_dtype(frame, date_columns=["date_column1", "date_column2"], dtype="timestamp[ns][pyarrow]")

return self._finalize_pandas_output(frame)

Expand Down

0 comments on commit 2ea84ee

Please sign in to comment.