Skip to content

GH-49503: [Docs][Python] Documenting .pxi doctests are tested via lib.pyx#49515

Merged
AlenkaF merged 3 commits into
apache:mainfrom
bhavanaeh:docs-pxi-doctest-info
Mar 20, 2026
Merged

GH-49503: [Docs][Python] Documenting .pxi doctests are tested via lib.pyx#49515
AlenkaF merged 3 commits into
apache:mainfrom
bhavanaeh:docs-pxi-doctest-info

Conversation

@bhavanaeh
Copy link
Copy Markdown
Contributor

@bhavanaeh bhavanaeh commented Mar 15, 2026

Rationale for this change

Running python -m pytest --doctest-cython directly on .pxi files doesn't work because Cython .pxi files are included in .pyx files at compile time. This isn't documented, which could potentially confuse contributors.

Please see discussion in #49279 (comment) by @AlenkaF for additional context.

What changes are included in this PR?

Added a note to the Doctest section of the Developing PyArrow documentation explaining that:

  • .pxi files cannot be tested directly with --doctest-cython
  • Doctests should be run on the .pyx file they are included in (e.g., lib.pyx)
  • Errors will appear under the .pyx file, not the original .pxi filename

Are these changes tested?

Documentation-only change. No code changes.

Are there any user-facing changes?

No.

@github-actions
Copy link
Copy Markdown

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

Comment thread docs/source/developers/python/development.rst
@bhavanaeh bhavanaeh changed the title GH-49503: [Python][Doc] Documenting .pxi doctests are tested via lib.pyx GH-49503: [Docs][Python] Documenting .pxi doctests are tested via lib.pyx Mar 15, 2026
@github-actions
Copy link
Copy Markdown

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

@AlenkaF
Copy link
Copy Markdown
Member

AlenkaF commented Mar 19, 2026

@github-actions crossbow submit preview-docs

@github-actions
Copy link
Copy Markdown

Revision: ecff1a1

Submitted crossbow builds: ursacomputing/crossbow @ actions-bfd9f4b8a6

Task Status
preview-docs GitHub Actions

Copy link
Copy Markdown
Member

@AlenkaF AlenkaF left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
Adding one comment from my side.

Comment thread docs/source/developers/python/development.rst
Comment thread docs/source/developers/python/development.rst Outdated
@bhavanaeh
Copy link
Copy Markdown
Contributor Author

@AlenkaF thanks for the comment, addressed!

Comment thread docs/source/developers/python/development.rst Outdated
@AlenkaF AlenkaF merged commit 8a8e574 into apache:main Mar 20, 2026
10 checks passed
@AlenkaF AlenkaF removed the awaiting committer review Awaiting committer review label Mar 20, 2026
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 2 benchmarking runs that have been run so far on merge-commit 8a8e574.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 9 possible false positives for unstable benchmarks that are known to sometimes produce them.

thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Apr 6, 2026
…ia lib.pyx (apache#49515)

### Rationale for this change

Running `python -m pytest --doctest-cython` directly on `.pxi` files doesn't work because Cython `.pxi` files are included in `.pyx` files at compile time. This isn't documented, which could _potentially_ confuse contributors.

Please see discussion in apache#49279 (comment) by @ AlenkaF for additional context.

### What changes are included in this PR?

Added a `note` to the Doctest section of the Developing PyArrow documentation explaining that:
- `.pxi` files cannot be tested directly with `--doctest-cython`
- Doctests should be run on the `.pyx` file they are included in (e.g., `lib.pyx`)
- Errors will appear under the `.pyx` file, not the original `.pxi` filename

### Are these changes tested?

Documentation-only change. No code changes.

### Are there any user-facing changes?

No.

* GitHub Issue: apache#49503

Lead-authored-by: Bhavana Sundar <bhavana7899@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
Mottl pushed a commit to Mottl/arrow that referenced this pull request May 26, 2026
…ia lib.pyx (apache#49515)

### Rationale for this change

Running `python -m pytest --doctest-cython` directly on `.pxi` files doesn't work because Cython `.pxi` files are included in `.pyx` files at compile time. This isn't documented, which could _potentially_ confuse contributors.

Please see discussion in apache#49279 (comment) by @ AlenkaF for additional context.

### What changes are included in this PR?

Added a `note` to the Doctest section of the Developing PyArrow documentation explaining that:
- `.pxi` files cannot be tested directly with `--doctest-cython`
- Doctests should be run on the `.pyx` file they are included in (e.g., `lib.pyx`)
- Errors will appear under the `.pyx` file, not the original `.pxi` filename

### Are these changes tested?

Documentation-only change. No code changes.

### Are there any user-facing changes?

No.

* GitHub Issue: apache#49503

Lead-authored-by: Bhavana Sundar <bhavana7899@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
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.

2 participants