NVIDIA-NeMo / NVIDIA-NeMo/Anonymizer
chore: resolve ty type checker diagnostics (41 errors)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 122
- Forks
- 17
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 11
Description
Summary
After adding ty (v0.0.23) as a type checker, the codebase has 41 diagnostics that need to be resolved before typecheck can become a blocking CI check and pre-commit hook.
Currently, typecheck is advisory (non-blocking) in both the Makefile (- prefix) and pre-commit (|| true).
Diagnostic categories
Source code (~14 errors)
custom_columns.py(7 errors) -- Passinglist[dict]from.as_dict()calls wherelist[EntitySchema]is expected. Pydantic accepts dicts at runtime, but ty's static analysis doesn't know that. Fix: pass model instances directly, or add# ty: ignorecomments.postprocess.py(5 errors) --dict.get()overload resolution failures on dicts with inferred narrow key types afterisinstanceguards.
Test code (~20+ errors)
- Tests passing raw dicts where Pydantic model instances are expected (same pattern as source)
AnonymizerConfig(detect={...})-- passing dict instead ofDetectmodeltest_debug_logging.py--tmp_pathfixture typed asTempPathFactoryinstead ofPathtempfile.mktempdeprecation warning
Excluded (already handled)
tools/is excluded via[tool.ty.src] exclude = ["tools/"]since those scripts use PEP 723 inline deps not in the venv.
Definition of done
- All 41 diagnostics resolved (fix or suppress with targeted
# ty: ignore[rule-name]) - Remove
|| truefrom typecheck pre-commit hook - Remove
-prefix from Makefiletypechecktarget - Typecheck CI job made blocking (remove
continue-on-errorif set)
References
- PR #51 introduced ty and the advisory typecheck infrastructure
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the advisory ty typecheck and group the 41 diagnostics across custom_columns.py, postprocess.py, the test files, Makefile, pre-commit hook, and CI configuration. Resolve or narrowly suppress each reported diagnostic, then make the checks blocking by removing the advisory wrappers and verify that typecheck passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100