Skip to content

chore: re-export DocumentStream explicitly for type checkers#3181

Merged
cau-git merged 1 commit into
docling-project:mainfrom
Eugenio-BAYE:fix/document-stream-export
Mar 25, 2026
Merged

chore: re-export DocumentStream explicitly for type checkers#3181
cau-git merged 1 commit into
docling-project:mainfrom
Eugenio-BAYE:fix/document-stream-export

Conversation

@Eugenio-BAYE
Copy link
Copy Markdown
Contributor

Fixes #3165

DocumentStream was imported with a plain import, which Pyright treats as a private symbol in py.typed packages and raises reportPrivateImportUsage for users importing it from docling.datamodel.base_models.

Using import X as X (PEP 484) marks it as an intentional re-export.

Fixes docling-project#3165

Signed-off-by: Eugenio-BAYE <baye.eugenio.egnb@gmail.com>
Copilot AI review requested due to automatic review settings March 24, 2026 20:33
@github-actions
Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @Eugenio-BAYE, all your commits are properly signed off. 🎉

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 24, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a static type-checking (Pyright) export issue by making DocumentStream an explicit re-export from docling.datamodel.base_models, aligning with PEP 484 expectations for py.typed packages.

Changes:

  • Switches DocumentStream import to an explicit re-export form (DocumentStream as DocumentStream) so type checkers treat it as public.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cau-git cau-git changed the title fix: re-export DocumentStream explicitly for type checkers chore: re-export DocumentStream explicitly for type checkers Mar 25, 2026
@cau-git cau-git merged commit 53412ed into docling-project:main Mar 25, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DocumentStream not exported from docling.datamodel.base_models for type checkers

3 participants