feat: Migrate type checking from mypy to ty - #5
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces mypy with ty as the project's type checker, updates configuration files, and expands the CONTRIBUTING.md documentation with development commands and contribution guidelines. The reviewer feedback highlights three main areas for improvement: first, the configuration in pyproject.toml broadly ignores core type-checking rules, which significantly reduces the utility of static analysis; second, the documentation incorrectly describes ty as Astral's Rust-based type checker (which is actually redknot); and third, a dictionary lookup in fixed_schema_enricher.py can be simplified using .get() to avoid a double lookup and eliminate an inline type ignore.
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.
Summary
Migrate the project type checker from mypy to
tyand apply the source updates required fortycompatibility.Changes
mypywithtyinpyproject.toml[tool.mypy]configuration[tool.ty]configuration and overridesMakefilesomake lint-typingrunsuv run ty check src/ teststyhookmypytotytycompatibility:Datasetannotations fromload_dataset(...)callsDatasetimportstycompatibility# type: ignorecomments wheretyno longer requires themtyChecklist
make lint-check)make lint-typing)make lint-typos)make security-bandit)make security-audit)uv run pre-commit run --all-files)