Support pandas 3.0 in doctests - #116
Merged
Merged
Conversation
pandas 3.0.0 made a dedicated string dtype the default (PDEP-14): a plain string-typed Series now reprs as `dtype: str` instead of `dtype: object`. This doctest in docs/usage.rst asserted the exact `object` text, so it started failing under pandas>=3.0 even though nothing about the actual output data changed. Sybil's DocTestParser for this file already runs with the ELLIPSIS option flag (see docs/conftest.py), so relaxing the assertion to `dtype: ...` is enough -- it matches either `object` or `str` (or whatever a future pandas release calls it), without pinning pandas or adding any version-conditional logic to the docs. Verified locally: `uv run pytest docs/usage.rst` now passes all 72 examples (previously 1 failed) under the installed pandas 3.0.5. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRelaxes a doctest dtype assertion in docs/usage.rst so it remains valid under both pandas<3.0 (object dtype) and pandas>=3.0 (new string dtype), leveraging existing ellipsis matching. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
hagenw
reviewed
Aug 5, 2026
Member
|
Can you claude somehow tell that it should stay within the 51 commit message limit for the names of the pull requests? |
hagenw
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
docs/usage.rstdoctest surfaced by audonnx#115 (the CIaction-version-bump rollout) fails under
pandas>=3.0, unrelated tothat PR's diff.
Root cause: pandas 3.0.0 made a dedicated string dtype the default
(PDEP-14).
Per pandas' own migration guide:
"In pandas < 3.0, a Series of strings would have
dtype: object, butin pandas 3.0 the same code results in
dtype: str." The failing runinstalled
pandas==3.0.5. Nothing about the actual output datachanged -- only how pandas 3.0 labels the column's dtype.
Fix
Sybil's
DocTestParserfor this file already runs with theELLIPSISoption flag (
docs/conftest.py), so relaxing the assertion fromdtype: objecttodtype: ...is enough -- it matches eitherobjectorstr(or whatever a future pandas release calls it),without pinning pandas or adding version-conditional logic to the docs.
Test plan
uv run pytest docs/usage.rstpasses all 72 examples locally(previously 1 failed) under pandas 3.0.5