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

Fails to read v2 consolidated metadata if .zattrs is not present #2754

Closed
nbren12 opened this issue Jan 23, 2025 · 2 comments
Closed

Fails to read v2 consolidated metadata if .zattrs is not present #2754

nbren12 opened this issue Jan 23, 2025 · 2 comments
Labels
bug Potential issues with the zarr-python library

Comments

@nbren12
Copy link

nbren12 commented Jan 23, 2025

Zarr version

v3

Numcodecs version

n/a

Python Version

3.12

Operating System

Linux

Installation

pip

Description

I have a zarr v2 dataset with no group level .zattrs. I have consolidated the metadata to .zmetadata. This dataset opens successfully in zarr==2 but v3 is not using the consolidated metadata, and openings hangs indefinitely as it lists every key.

The error is caused by this line of code:

v2_consolidated_metadata.pop(".zattrs", None)

This seems like a bug. It will fail if the .zattrs is not present, but the v2 spec states

The “.zattrs” key does not have to be present, and if it is absent the attributes should be treated as empty.

Steps to reproduce

.

Additional output

No response

@nbren12 nbren12 added the bug Potential issues with the zarr-python library label Jan 23, 2025
@jhamman
Copy link
Member

jhamman commented Jan 23, 2025

Thanks @nbren12 for the report! Are you using 3.0.1? I think we had a related fix for this from #2694.

@nbren12
Copy link
Author

nbren12 commented Jan 23, 2025

Thanks Joe. Sorry for the duplicate issue. zarr==3.0.1 works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential issues with the zarr-python library
Projects
None yet
Development

No branches or pull requests

2 participants