Skip to content

Conversation

max-sixty
Copy link
Collaborator

Summary

This PR removes test_coding_times.py and test_dask.py from the mypy exclusion list and fixes all resulting type errors.

Changes made

  • Removed xarray.tests.test_coding_times and xarray.tests.test_dask from the mypy check_untyped_defs = false exclusion list in pyproject.toml
  • Fixed type errors in test_dask.py by:
    • Adding explicit type annotations for heterogeneous lists
    • Importing Any from typing
    • Converting numpy arrays to lists where needed for better type compatibility
    • Adding minimal type: ignore comments only where necessary (e.g., intentional test of error conditions)
  • Fixed type error in scipy_.py for the fallback import case

Test plan

  • All mypy checks pass (uv run dmypy run)
  • Pre-commit hooks pass
  • Tests for modified files pass

🤖 Generated with Claude Code

- Removed test_coding_times and test_dask from mypy exclusion list
- Fixed type errors in test_dask.py by adding explicit type annotations
- Fixed scipy_.py type error with fallback import
- Reduced type: ignore comments by using proper type hints where possible

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty enabled auto-merge (squash) September 18, 2025 15:48
@max-sixty
Copy link
Collaborator Author

@pydata/xarray we now have our tests fully testing our library's type defns — we're much less likely to release code that is badly typed

(...and ratcheted in, so new tests will always test the library's types)

@max-sixty max-sixty merged commit 43a7f1e into pydata:main Sep 18, 2025
36 checks passed
@max-sixty max-sixty deleted the mypy-reduce-exclusion-final branch September 18, 2025 17:55
max-sixty added a commit to max-sixty/xarray that referenced this pull request Sep 18, 2025
Documents the removal of all test files from mypy exclusions in PR pydata#10768.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
max-sixty added a commit that referenced this pull request Sep 18, 2025
Documents the removal of all test files from mypy exclusions in PR #10768.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
@shoyer
Copy link
Member

shoyer commented Sep 18, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants