Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore attrs del functionality #2908

Merged
merged 5 commits into from
Mar 17, 2025
Merged

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Mar 12, 2025

Restore the bevahior of del obj.attrs['some-key'] to the pre #2870 behavior

Fixes: #2903

TODO:

  • Add unit tests and/or doctests in docstrings
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Mar 12, 2025

def test_del_works() -> None:
store = zarr.storage.MemoryStore()
z = zarr.create(10, store=store, overwrite=True)
Copy link
Member

Choose a reason for hiding this comment

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

Please change this to create_array or create_group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used parametrize to test both.

Copy link
Member

@jhamman jhamman left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @ianhi. Two suggestions to your tests.

@github-actions github-actions bot removed the needs release notes Automatically applied to PRs which haven't added release notes label Mar 17, 2025
@ianhi ianhi closed this Mar 17, 2025
@ianhi ianhi reopened this Mar 17, 2025
@dcherian dcherian merged commit 5968fc7 into zarr-developers:main Mar 17, 2025
55 of 56 checks passed
@ianhi ianhi deleted the del-fix branch March 17, 2025 22:00
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.

Attributes.__delitem__ is broken
3 participants