Skip to content

feat: add type annotations to target and contrib modules#3412

Open
kitagry wants to merge 3 commits intospotify:masterfrom
kitagry:add-target-type
Open

feat: add type annotations to target and contrib modules#3412
kitagry wants to merge 3 commits intospotify:masterfrom
kitagry:add-target-type

Conversation

@kitagry
Copy link
Copy Markdown
Contributor

@kitagry kitagry commented Apr 5, 2026

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 annotations
  • luigi/contrib/gcs.py: enable GCS target type (unblock from ignore list)
  • luigi/contrib/hadoop.py: add type annotations, add types-requests dep

Have you tested this? If so, how?

I ran mypy on the modified modules and confirmed no new type errors are introduced.

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.

1 participant