Skip to content

Added PEP 484 type hints to the four public methods in CSVFormat (src/tablib/formats/_csv.py).#642

Open
yehorcallmedai-maker wants to merge 4 commits into
jazzband:masterfrom
yehorcallmedai-maker:symbiote/plan-df8c58c8
Open

Added PEP 484 type hints to the four public methods in CSVFormat (src/tablib/formats/_csv.py).#642
yehorcallmedai-maker wants to merge 4 commits into
jazzband:masterfrom
yehorcallmedai-maker:symbiote/plan-df8c58c8

Conversation

@yehorcallmedai-maker

@yehorcallmedai-maker yehorcallmedai-maker commented May 28, 2026

Copy link
Copy Markdown

Adds PEP 484 type hints to the four public methods in CSVFormat (src/tablib/formats/_csv.py). No logic or docstring changes.

Signatures:
export_stream_set(dataset: Any, **kwargs: Any) -> StringIO
export_set(dataset: Any, **kwargs: Any) -> str
import_set(dset: Any, in_stream: TextIO, headers: bool, skip_lines: int, **kwargs: Any) -> None
detect(stream: TextIO, delimiter: Optional[str]) -> bool

Generated and verified with Symbiote, an internal AI-assisted annotation pipeline that maps the import graph and inserts typing without touching executable logic. Flagging that up front in case it matters for review.

Open to tightening any of the Any annotations if narrower types make sense here.

Symbiote and others added 2 commits May 28, 2026 18:54
…e public functions in src/tablib/formats/_csv.py. Do not modify executable logic, existing comments, or docstrings.
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.15%. Comparing base (7503651) to head (ae5e3c0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #642   +/-   ##
=======================================
  Coverage   93.14%   93.15%           
=======================================
  Files          29       29           
  Lines        3226     3227    +1     
=======================================
+ Hits         3005     3006    +1     
  Misses        221      221           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugovk

hugovk commented Jun 1, 2026

Copy link
Copy Markdown
Member

We don't currently have type hints in this project or any type checking in the CI. I'm curious why you chose to add type hints to these four methods in particular?

@yehorcallmedai-maker

Copy link
Copy Markdown
Author

These four are the only public methods on CSVFormat — the rest of the interface is private. The intent was a minimal, non-breaking annotation of exactly what callers interact with, without touching internal logic or docstrings.
Fair point that there's no type-checking in CI. If it helps, I'm happy to add a scoped mypy --ignore-missing-imports src/tablib/formats/_csv.py step — low friction, no impact on the rest of the codebase, and it means the annotations are machine-verified going forward.
Happy to add that, or to close this if the project isn't looking to start a typing story yet.

@yehorcallmedai-maker

Copy link
Copy Markdown
Author

Following up here — if adding the scoped mypy check I mentioned (mypy --ignore-missing-imports src/tablib/formats/_csv.py) would help move this forward, I can add it. Or if type hints aren't something you want to start with yet, closing this is fine too. Either way works on my end.

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.

2 participants