Added PEP 484 type hints to the four public methods in CSVFormat (src/tablib/formats/_csv.py).#642
Open
yehorcallmedai-maker wants to merge 2 commits into
Open
Conversation
…e public functions in src/tablib/formats/_csv.py. Do not modify executable logic, existing comments, or docstrings.
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added PEP 484 type hints to the four public methods in CSVFormat (src/tablib/formats/_csv.py).
Here's a quick look at the newly annotated 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
I made sure to leave the underlying logic and docstrings completely alone—this is strictly a typing update. Full disclosure, I let an automated tool called Symbiote handle the heavy lifting for this. It maps the import graph and drops in the annotations, which honestly saves a ton of tedious grunt work without stepping on the actual executable code.
I'd love to hear your thoughts on this. Let me know if these types look right to you, or if you think we should tighten up any of those Any annotations before merging!