Skip to content

Fix mypy failure: drop dead zarr<3 branch in invalid-store test - #11366

Merged
ianhi merged 1 commit into
pydata:mainfrom
hmaarrfk:fix-zarr-create-dataset-mypy
May 29, 2026
Merged

Fix mypy failure: drop dead zarr<3 branch in invalid-store test#11366
ianhi merged 1 commit into
pydata:mainfrom
hmaarrfk:fix-zarr-create-dataset-mypy

Conversation

@hmaarrfk

@hmaarrfk hmaarrfk commented May 29, 2026

Copy link
Copy Markdown
Contributor

Seems like min value for zarr is 3.0 at runtime

"zarr>=3.0",

Claude's draft

test_raises_key_error_on_invalid_zarr_store branched on zarr.__version__ < 3.0.0 and called Group.create_dataset, which no longer exists in zarr 3. Since xarray's minimum supported zarr is now 3.0, that branch is dead code and mypy fails with:

"Group" has no attribute "create_dataset"  [attr-defined]

Drop the version guard and always use Group.create_array.

Co-authored-by: Claude noreply@anthropic.com

Resume this Claude session:

claude --resume 9faa34e9-aaf5-4e94-a2b7-b03f468175f8

Description

Checklist

  • Closes #xxxx
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Claude

<details><summary>Claude's draft</summary>

`test_raises_key_error_on_invalid_zarr_store` branched on
`zarr.__version__ < 3.0.0` and called `Group.create_dataset`, which no
longer exists in zarr 3. Since xarray's minimum supported zarr is now 3.0,
that branch is dead code and mypy fails with:

    "Group" has no attribute "create_dataset"  [attr-defined]

Drop the version guard and always use `Group.create_array`.

Co-authored-by: Claude <noreply@anthropic.com>

Resume this Claude session:
```
claude --resume 9faa34e9-aaf5-4e94-a2b7-b03f468175f8
```
</details>

@ianhi ianhi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome thanks!

@ianhi
ianhi merged commit 4d16837 into pydata:main May 29, 2026
43 checks passed
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.

3 participants