Skip to content

Commit

Permalink
Use dict(batch.sizes) instead of batch.sizes.mapping
Browse files Browse the repository at this point in the history
To fix `error: "Mapping[Hashable, int]" has no attribute "mapping"  [attr-defined]`, due to incorrect type hint in upstream xarray.
  • Loading branch information
weiji14 committed Jan 1, 2024
1 parent f50c5f4 commit 5dbd411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbatcher/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def validate_batch_dimensions(

# Check the names and lengths of the dimensions are equal
TestCase().assertDictEqual(
expected_dims, batch.sizes.mapping, msg="Dimension names and/or lengths differ"
expected_dims, dict(batch.sizes), msg="Dimension names and/or lengths differ"
)
# Check the dimension order is equal
for var in batch.data_vars:
Expand Down

0 comments on commit 5dbd411

Please sign in to comment.