Skip to content

TST: Enable doctest for dataframe.rst #19716

Closed

Description

@pllim

The documentation docs/table/dataframes.rst was added in #18435 but it is not running doctest:

.. doctest-skip-all

Given this is probably widely used, skipping doctest blindly is undesirable. Instead one could utilize .. doctest-requires:: directive to conditionally skip examples if the required backend is not installed. Even if this backend is not installed in the CI (which I think it might for alldeps job anyway), one could still run it locally if desired.

Activity

  1. RadeshL commented on May 17, 2026

    @RadeshL

    hey I would love to contribute to this issue, can I be assigned with it?

    My proposed solution:

    1. Remove ..doctest-skip-all from the file
    2. Add ..doctest-requires :: dierectives per block
    3. Preserve continuity of state of the block by consolidating dependent statements into self contained doctest blocks
  2. arsenelupin14 commented on May 23, 2026

    @arsenelupin14
    Contributor

    Hi. I noticed this issue is still open.
    I willing to address the problem with the .. doctest-skip-all and i have already removed it and applied ..doctest-requires:: for pandas and polars especially to the @blocks

    Other couple of solutions that i implement:

    1. Keeping the original code blocks separated rather than merging them into 1 block (Sphinx naturally maintains the state across the blocks).
    2. Added a .. doctest-skip:: specifically for the Excel example ( pandas.read_excel ) to prevent CI failures since the illustrative myexceltable.xlsx (file isn't existed yet on the repository.

    But this approach had a two trade off:

    1. Untested Excel Snippet: By using .. doctest-skip:: for the read_excel, specifically snippet is now a gap in the CI.
    2. Pandas string/nullable representations (like , string8, str1) might cause the doctest to fail if the docs text is slightly outdated compared to the CI environment.
  3. added a commit that references this issue on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions