Skip to content

Conversation

@max-sixty
Copy link
Collaborator

Summary

  • Removes xarray.tests.test_combine from the mypy exclusion list
  • Enables check_untyped_defs for this test file

Changes

  1. pyproject.toml: Remove test_combine from mypy exclusions
  2. xarray/structure/combine.py: Fix type signature to accept None for concat_dim (matching runtime behavior)
  3. xarray/tests/test_combine.py: Add minimal type annotations where mypy cannot infer types

Notes

  • No behavioral changes - all existing code works exactly as before
  • The combine_nested function already accepted concat_dim=None at runtime (converting it to [None] internally), so we just updated the type signature to reflect this
  • All 118 tests pass (with 1 expected xfail)
  • Mypy now successfully type-checks this file

🤖 Generated with Claude Code

- Add type annotations to satisfy mypy's check_untyped_defs requirement
- Fix combine_nested type signature to accept None for concat_dim parameter
- Add minimal type hints where mypy cannot infer types
- No behavioral changes, all tests pass

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

Co-Authored-By: Claude <[email protected]>
@max-sixty max-sixty merged commit 558131e into pydata:main Sep 15, 2025
37 checks passed
@max-sixty max-sixty deleted the mypy-reduce-exclusion branch September 15, 2025 18:03
shoyer pushed a commit to shoyer/xarray that referenced this pull request Sep 16, 2025
- Add type annotations to satisfy mypy's check_untyped_defs requirement
- Fix combine_nested type signature to accept None for concat_dim parameter
- Add minimal type hints where mypy cannot infer types
- No behavioral changes, all tests pass

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

Co-authored-by: Claude <[email protected]>
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