Skip to content

GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+#49088

Merged
rok merged 1 commit intoapache:mainfrom
rok:fix_doctest_issues
Feb 5, 2026
Merged

GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+#49088
rok merged 1 commit intoapache:mainfrom
rok:fix_doctest_issues

Conversation

@rok
Copy link
Member

@rok rok commented Jan 30, 2026

Fixes: #49150
See #48619 (comment)

Rationale for this change

Fix CI failures

What changes are included in this PR?

Tests are made more general to allow for Pandas 2 and Pandas 3 style string types

Are these changes tested?

By CI

Are there any user-facing changes?

No

@rok rok changed the title [MINOR] Fix doctests failing on pandas 3 string types examples MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples Jan 30, 2026
@apache apache deleted a comment from github-actions bot Jan 30, 2026
@rok rok force-pushed the fix_doctest_issues branch from 060eab3 to f14ade1 Compare January 30, 2026 16:27
7 baz
dtype: category
Categories (3, object): ['foo', 'bar', 'baz']
Categories (3, ...): ['foo', 'bar', 'baz']
Copy link
Member

@jorisvandenbossche jorisvandenbossche Jan 30, 2026

Choose a reason for hiding this comment

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

FWIW, I think if we know the doctests will run on an instance with pandas>=3, I would just update those to use pandas 3 output, because that will be less confusing for people reading the docs ("what do those 3 dots mean here?").

Suggested change
Categories (3, ...): ['foo', 'bar', 'baz']
Categories (3, str): ['foo', 'bar', 'baz']

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to start testing on Pandas 3 exclusively? I believe we have both testing now. (One is not triggered for this PR because the scope is smaller)

Copy link
Member Author

Choose a reason for hiding this comment

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

If we do agree to stop doctest on Pandas 2.x.y then we should also update CI appropriately.

Copy link
Member

Choose a reason for hiding this comment

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

For general tests (unit tests) we certainly have to test with various pandas versions (i.e. whichever range we claim to support), but personally I think for doctests it is perfectly fine to just have those passing in one specific environment (they are not meant as actual proper tests, but only to ensure the docs are correct and kept up to date)

Copy link
Member Author

Choose a reason for hiding this comment

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

I like this approach. I've reverted changes so that this now tests expected pandas 3 behavior.
Additionally this also updates Python to 3.11 which then makes pandas-latest==3+.

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting committer review Awaiting committer review awaiting changes Awaiting changes labels Jan 30, 2026
@rok rok force-pushed the fix_doctest_issues branch from 4d0a733 to c84c874 Compare January 31, 2026 07:31
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jan 31, 2026
@rok rok force-pushed the fix_doctest_issues branch from c84c874 to 88da613 Compare January 31, 2026 09:33
@github-actions github-actions bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Jan 31, 2026
@rok rok force-pushed the fix_doctest_issues branch from 88da613 to 6482c71 Compare January 31, 2026 09:38
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jan 31, 2026
@rok rok force-pushed the fix_doctest_issues branch 2 times, most recently from dcbca14 to 130bfa4 Compare January 31, 2026 16:49
@rok
Copy link
Member Author

rok commented Jan 31, 2026

Thanks for the review @jorisvandenbossche ! Could you take another look before the merge?

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Jan 31, 2026
@rok rok requested a review from assignUser as a code owner February 1, 2026 00:15
@rok rok requested review from jonkeane, kou and raulcd as code owners February 1, 2026 00:15
@rok rok force-pushed the fix_doctest_issues branch from 98c6735 to f22181a Compare February 4, 2026 18:20
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Feb 4, 2026
@rok rok force-pushed the fix_doctest_issues branch from f22181a to a951f71 Compare February 4, 2026 18:42
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Feb 4, 2026
@rok rok changed the title MINOR: [Doc][CI] Fix doctests failing on pandas 3 string types examples GH-49150: [Doc][CI] Fix doctests failing on pandas 3 string types examples Feb 4, 2026
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

⚠️ GitHub issue #49150 has been automatically assigned in GitHub to PR creator.

@rok rok changed the title GH-49150: [Doc][CI] Fix doctests failing on pandas 3 string types examples GH-49150: [Doc][CI][Python] Doctests failing on doctests in rst files due to pandas 3+ Feb 4, 2026
@rok rok changed the title GH-49150: [Doc][CI][Python] Doctests failing on doctests in rst files due to pandas 3+ GH-49150: [Doc][CI][Python] Doctests failing on rst files due to pandas 3+ Feb 4, 2026
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Feb 4, 2026
@rok
Copy link
Member Author

rok commented Feb 4, 2026

"Docs / AMD64 Debian 12 Complete Documentation" seems to be failing for CRAN reasons:

-- Building articles -----------------------------------------------------------
Warning message:
@examplesIf condition "arrow_with_dataset() &&
identical(Sys.getenv(\"NOT_CRAN\"), \"true\")" is "FALSE"
---
Backtrace:
1. pkgdown::build_site(install = FALSE)
2. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_d...
3. callr::r(function(..., cli_colors, hyperlinks) { ...
4. callr:::get_result(output = out, options)
5. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
---
Subprocess backtrace:
 1. pkgdown::build_site(...)
 2. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont...
 3. pkgdown::build_articles(pkg, lazy = lazy, override = override, quiet = quiet, ...
 4. pkgdown::build_articles_index(pkg)
 5. pkgdown::render_page(pkg, "article-index", data = data_articles_index(pkg), ...
 6. pkgdown:::render_page_html(pkg, name = name, data = data, depth = depth)
 7. pkgdown:::modify_list(data_template(pkg, depth = depth), data)
 8. pkgdown:::data_articles_index(pkg)
 9. pkgdown:::config_abort(pkg, "{length(missing)} vignette{?s} missing from index: {....
10. cli::cli_abort(message, ..., call = call, .envir = .envir)
11. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, ...
12. | rlang:::signal_abort(cnd, .file)
13. | base::signalCondition(cnd)
14. global (function (e) ...
Execution halted

Error: `docker compose --file=/home/runner/work/arrow/arrow/compose.yaml run --rm debian-docs` exited with a non-zero exit code 1, see the process 

cc @thisisnic

@thisisnic
Copy link
Member

"Docs / AMD64 Debian 12 Complete Documentation" seems to be failing for CRAN reasons:

-- Building articles -----------------------------------------------------------
Warning message:
@examplesIf condition "arrow_with_dataset() &&
identical(Sys.getenv(\"NOT_CRAN\"), \"true\")" is "FALSE"
---
Backtrace:
1. pkgdown::build_site(install = FALSE)
2. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_d...
3. callr::r(function(..., cli_colors, hyperlinks) { ...
4. callr:::get_result(output = out, options)
5. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
---
Subprocess backtrace:
 1. pkgdown::build_site(...)
 2. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont...
 3. pkgdown::build_articles(pkg, lazy = lazy, override = override, quiet = quiet, ...
 4. pkgdown::build_articles_index(pkg)
 5. pkgdown::render_page(pkg, "article-index", data = data_articles_index(pkg), ...
 6. pkgdown:::render_page_html(pkg, name = name, data = data, depth = depth)
 7. pkgdown:::modify_list(data_template(pkg, depth = depth), data)
 8. pkgdown:::data_articles_index(pkg)
 9. pkgdown:::config_abort(pkg, "{length(missing)} vignette{?s} missing from index: {....
10. cli::cli_abort(message, ..., call = call, .envir = .envir)
11. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, ...
12. | rlang:::signal_abort(cnd, .file)
13. | base::signalCondition(cnd)
14. global (function (e) ...
Execution halted

Error: `docker compose --file=/home/runner/work/arrow/arrow/compose.yaml run --rm debian-docs` exited with a non-zero exit code 1, see the process 

cc @thisisnic

I just merged a fix, if you rebase it should be good for the R docs now :)

@rok rok force-pushed the fix_doctest_issues branch from a951f71 to ae226b4 Compare February 4, 2026 22:40
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Feb 4, 2026
@rok
Copy link
Member Author

rok commented Feb 5, 2026

Thanks @thisisnic, rebasing seems to fix the CI! Merging.

@rok rok merged commit 1cd1841 into apache:main Feb 5, 2026
24 of 26 checks passed
@rok rok removed the awaiting change review Awaiting change review label Feb 5, 2026
@rok rok deleted the fix_doctest_issues branch February 5, 2026 00:06
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.

[Doc][CI][Python] Doctests failing on rst files due to pandas 3+

4 participants