Skip to content

Make metadata parameter mandatory in encode_group_metadata #588

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

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Next release
By :user:`Josh Moore <joshmoore>`; :issue:`571`.


* ``encode_group_metadata`` metadata parameter is now mandatory.


.. _release_2.4.0:

2.4.0
Expand Down
8 changes: 2 additions & 6 deletions zarr/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@ def decode_group_metadata(s):
return meta


# N.B., keep `meta` parameter as a placeholder for future
# noinspection PyUnusedLocal
def encode_group_metadata(meta=None):
meta = dict(
zarr_format=ZARR_FORMAT,
)
def encode_group_metadata(meta):
meta["zarr_format"] = ZARR_FORMAT
return json_dumps(meta)


Expand Down
2 changes: 1 addition & 1 deletion zarr/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def test_init_array_overwrite_group(self):
# setup
path = 'foo/bar'
store = self.create_store()
store[path + '/' + group_meta_key] = encode_group_metadata()
store[path + "/" + group_meta_key] = encode_group_metadata({})

# don't overwrite
with pytest.raises(ValueError):
Expand Down