Skip to content

TST: Enable doctest for dataframes.rst (#19716) - #19804

Merged
pllim merged 6 commits into
astropy:mainfrom
arsenelupin14:fix-doctest-19716
May 29, 2026
Merged

pllim merged 6 commits into
astropy:mainfrom
arsenelupin14:fix-doctest-19716

Conversation

@arsenelupin14

@arsenelupin14 arsenelupin14 commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #19716

This pull request is to address the missing doctest coverage in docs/table/dataframes.rst as discussed in #19716.
Here's the summary of the implementation:

  1. Removed the .. doctest-skip-all from docs/table/dataframes.rst and docs/table/pandas.rst.
  2. Applied .. doctest-requires:: , added requirements for pandas and polars only to specific blocks that need them.
  3. Keeping the original code blocks separated rather than merging them into 1 block. Sphinx doctest naturally maintain the state across blocks.
  4. Added an explicit .. doctest-skip:: for the Excel example (pandas.read_excel): Since the myexceltable.xlsx file doesnt exist in the repository, to prevents unavoidable CI failures.

https://astropy--19804.org.readthedocs.build/en/19804/table/dataframes.html

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

Comment thread docs/changes/19804.other.rst Resolved
Comment thread docs/table/dataframes.rst Resolved
@pllim pllim added the Extra CI Run cron CI as part of PR label May 28, 2026
Ikbar Faiz added 5 commits May 28, 2026 13:15
Adds `.. doctest-skip::` to `type(df)` assertions to prevent failures on older pandas versions (where output is `pandas.core.frame.DataFrame`). Also fixes a pre-existing formatting mismatch in `Table.from_pandas` output (string8 to str1).
@pllim
pllim force-pushed the fix-doctest-19716 branch from ea67530 to b00e0c8 Compare May 28, 2026 17:15
@pllim

pllim commented May 28, 2026

Copy link
Copy Markdown
Member

Remote data and link check failures are unrelated.

@pllim pllim removed the Extra CI Run cron CI as part of PR label May 28, 2026

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Extra CI looked good on 2026-05-28 run, so I removed the label for future runs as my comments here are minor.

Comment thread docs/table/dataframes.rst Resolved
Comment thread docs/table/dataframes.rst Resolved
Per reviewer request, replaces unconditional `.. doctest-skip::` with `.. doctest-requires:: pandas>=3.0` to ensure the type() assertion runs on modern pandas versions, and updates expected string back to `<class 'pandas.DataFrame'>`.
@neutrinoceros
neutrinoceros removed their request for review May 29, 2026 06:43

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pllim
pllim merged commit c373cc2 into astropy:main May 29, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TST: Enable doctest for dataframe.rst

2 participants