Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/4059.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Prevents mutation of the attributes dict provided by the user by copying them instead of keeping the reference
2 changes: 1 addition & 1 deletion src/zarr/core/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def parse_attributes(data: Any) -> dict[str, Any]:
if data is None:
return {}
elif isinstance(data, dict) and all(isinstance(k, str) for k in data):
return data
return dict(data)
msg = f"Expected dict with string keys. Got {type(data)} instead."
raise TypeError(msg)

Expand Down
2 changes: 1 addition & 1 deletion src/zarr/core/metadata/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def parse_attributes(data: dict[str, JSON] | None) -> dict[str, JSON]:
if data is None:
return {}

return data
return dict(data)
Loading