Skip to content

BUG: read_sql with dtype_backend="pyarrow" returns date/time as string (#56551)#66353

Open
aboderinsamuel wants to merge 2 commits into
pandas-dev:mainfrom
aboderinsamuel:bug-63283-dt-seconds
Open

BUG: read_sql with dtype_backend="pyarrow" returns date/time as string (#56551)#66353
aboderinsamuel wants to merge 2 commits into
pandas-dev:mainfrom
aboderinsamuel:bug-63283-dt-seconds

Conversation

@aboderinsamuel

@aboderinsamuel aboderinsamuel commented Jul 16, 2026

Copy link
Copy Markdown

With dtype_backend="pyarrow", read_sql returned datetime.date and datetime.time
columns as string[pyarrow] instead of date32/time64 (datetime columns were already
correct). These objects have no NumPy dtype, so the object-array conversion fell back to
string before pyarrow could infer the type. The fix re-infers such columns via pyarrow only
when the values are date/time; numeric, string, null, and decimal columns are unchanged.

Tested directly against _convert_arrays_to_dataframe because SQLite returns date/time as
text and cannot exercise the object-to-arrow conversion path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: read_sql() does not handle date nor time datatypes correctly when using pyarrow (but works for datetime)

1 participant