-
Notifications
You must be signed in to change notification settings - Fork 485
Description
Background
As part of #5111 and #5119, we introduced mypy type checking to our CI pipeline. We now have ~5000 type: ignore comments scattered throughout the codebase that need to be properly addressed.
The goal of this issue is to track the gradual removal of these type: ignore comments by improving type coverage while maintaining correctness.
How you can help
We welcome contributions from the community! To ensure smooth collaboration and manageable reviews, please follow these guidelines when submitting PRs:
Reference this issue
In your PR description, reference this issue (#5138) so we can track overall progress.
Scope your PRs
Avoid submitting a massive PR that removes hundreds of type: ignore comments at once. Instead, focus on a specific module, feature, or component.
Keep PRs meaningful
Each PR should aim to properly type the affected code, not just remove the type: ignore comments blindly.
Follow example PRs
#5126 is a good example of a well-scoped PR that fixes mypy exclusions.
Run tests
Ensure that your changes pass mypy, unit tests, and linters. Use the following tools:
make testto run the test suite.make typecheckto run mypy.pre-commit installto run the linters automatically for your commits. Refer to pre-commit quickstart guide for installation instructions.
How to get started
- Find a
type: ignorecomment in the codebase (search for# type: ignore).- Tip: a
# type: ignore[no-untyped-def]comment is the most common one, and usually the most straightforward to fix — it denotes missing typing annotations.
- Tip: a
- Analyse why it was added (e.g., missing annotations, incompatible types).
- Properly fix the typing issue rather than just removing the comment.
- Verify your changes by running
pre-commitandmake test. - Open a PR referencing this issue ([Tracking Issue] Remove
type: ignorecomments from Python code #5138).
Questions?
If you're unsure about a specific change, feel free to open a discussion or ask in this issue!
🚀 Happy typing! 🚀