feat: add type annotations to target and contrib modules#3412
Open
kitagry wants to merge 3 commits intospotify:masterfrom
Open
feat: add type annotations to target and contrib modules#3412kitagry wants to merge 3 commits intospotify:masterfrom
kitagry wants to merge 3 commits intospotify:masterfrom
Conversation
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.
Description
Add mypy type annotations to
luigi/target.py,luigi/format.py, and several contrib modules (s3,webhdfs,gcs,hadoop). This is part of the gradual type-checking adoption introduced in #3403.Motivation and Context
Following the mypy infrastructure introduced in #3403 and the parameter class annotations in #3406, this PR extends type coverage to the Target layer and key contrib modules — enabling static analysis to catch type errors in the core I/O abstractions.
Changes per commit:
luigi/target.py,luigi/contrib/s3.py,luigi/contrib/webhdfs.py,luigi/format.py: add Target type annotationsluigi/contrib/gcs.py: enable GCS target type (unblock from ignore list)luigi/contrib/hadoop.py: add type annotations, addtypes-requestsdepHave you tested this? If so, how?
I ran mypy on the modified modules and confirmed no new type errors are introduced.