Skip to content

DOC: fix doctests for repr changes with the new string dtype #61886

@jorisvandenbossche

Description

@jorisvandenbossche

Now the string dtype is turned on by default (#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 -> #61890), and the failing files are:

  • pandas/core/base.py
  • pandas/core/generic.py
  • pandas/core/strings/accessor.py
  • pandas/core/arrays/datetimelike.py, pandas/core/arrays/datetimes.py and pandas/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: #61887

Metadata

Metadata

Assignees

Labels

BlockerBlocking issue or pull request for an upcoming releaseBlocker for rcBlocking issue or pull request for release candidateDocsStringsString extension data type and string data

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions