Skip to content

Tables: handle pandas 3 str dtype for time and string columns - #206

Merged
ebranlard merged 1 commit into
ebranlard:devfrom
yarrrly:pandas3-string-dtype
Nov 23, 2026
Merged

ebranlard merged 1 commit into
ebranlard:devfrom
yarrrly:pandas3-string-dtype

Conversation

@yarrrly

@yarrrly yarrrly commented Nov 22, 2026

Copy link
Copy Markdown

pandas 3 reads text columns with the str dtype instead of object. The dtype == object checks in convertTimeColumns and getColumn skip them: a time column stays text (x range shows NA) and text columns are not flagged as strings. A CSV with an ISO time column shows it.

The patch accepts pd.StringDtype in both checks and lets pandas 3 use the pandas 2 branch of convertTimeColumn, since the legacy branch passes infer_datetime_format (removed in pandas 3).

The new test_text_columns fails on pandas 3.1.1 without the change. The make test suites pass on pandas 2.3.3 and 3.1.1.

pandas 3 reads text columns with the new str dtype, so the
'dtype == object' checks in convertTimeColumns and getColumn skip them:
time columns are not converted to datetime and text columns are not
flagged as strings. Accept pd.StringDtype in both checks, and use the
pandas >= 2 branch of convertTimeColumn for pandas 3 too (the legacy
branch passes infer_datetime_format, which pandas 3 removed).
@ebranlard
ebranlard merged commit aa30820 into ebranlard:dev Nov 23, 2026
4 checks passed
@ebranlard

Copy link
Copy Markdown
Owner

Thank you for doing that!

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.

2 participants