Now the string dtype is turned on by default (https://github.com/pandas-dev/pandas/pull/61722), we also have to fix the doctests to match the new behaviour (the doctests are currently, temporarily, allowed to fail to avoid red CI until this issue is fixed).
The failures can be seen in the current doctests logs, for example at https://github.com/pandas-dev/pandas/actions/runs/16332737970/job/46138722939#step:6:23
There are two main groups of failures:
- dtype: object
that needs to become dtype: str
in Series output (or object->str in some other reprs, and a few None->NaN changes)
- The representation of Categorical no longer using quoted values
I would propose to first start with the first bullet point (we should maybe reconsider if the categorical repr change is actually what we want -> https://github.com/pandas-dev/pandas/issues/61890), and the failing files are:
- [x]
pandas/core/base.py
(https://github.com/pandas-dev/pandas/pull/61905) - [x]
pandas/core/generic.py
- [x]
pandas/core/strings/accessor.py
- [x]
pandas/core/arrays/datetimelike.py
,pandas/core/arrays/datetimes.py
andpandas/core/indexes/datetimelike.py
Let's do one PR per bullet point here.
You can run the doctest and verify changes with for example:
pytest --doctest-modules pandas/core/base.py
Example PR for some fixes in other files: https://github.com/pandas-dev/pandas/pull/61887
Comment From: jorisvandenbossche
@Nadav-Zilberberg as I mentioned in the issue, please wait with the categorical failures (discussion for that in https://github.com/pandas-dev/pandas/issues/61890). Also do you have a PR for this that is "ready for review"? I don't see one, and the issue linking here is just a copy of this issue in your own repo, and so this looks more like spam.
Comment From: simonjayhawkins
@jorisvandenbossche added blocker tags since I think we want to revert the changes in #61722 for the doc build continue-on-error: true
before release?
Comment From: jorisvandenbossche
It's not critical for the RC, but ideally those are fixed for the final release (note the doc build itself is already fixed and running again, this is only the doctests)
Comment From: arthurlw
take
Comment From: jorisvandenbossche
@arthurlw can you comment on which file you are working? (@paulbehrisch already did the first one in the meantime)
Comment From: arthurlw
I’ll take on the second one then (pandas/core/generic.py
). Happy to coordinate if anyone else wants to work on the remaining files!
Comment From: DevastatingRPG
I'll take on the final bullet (final 3 files, arrays and indexes) if nobody's working on it @arthurlw
Comment From: arthurlw
Sounds good @DevastatingRPG 👍
Comment From: simonjayhawkins
It's not critical for the RC, but ideally those are fixed for the final release (note the doc build itself is already fixed and running again, this is only the doctests)
thanks @jorisvandenbossche for the info. yes I see that #61864 addresses the concern I had regarding the doc build and the reason I added the blocker tags. So therefore I am happy to now remove them.