Description
zarr array metadata in zarr v2 and v3 is different. v3 introduces concepts like chunk_grid
, chunk_key_encoding
, etc. The AsyncArray
class has to handle both metadata types, and so somewhere in the codebase we need a zarr-version-agnostic representation of the two metadata types.
Right now, we define extra properties on the array v2 metadata class to make it resemble the array v3 metadata. See this example. Doing this introduces coupling between the two metadata models, which is a mistake IMO because they are separable entities. It is also unclear how we would refactor things if we were to ever introduce a new type of array metadata document.
I think a better solution to this problem is for routines that consume the two flavors of metadata documents (right now, AsyncArray
) to be responsible for abstracting over the differences between v2 and v3 metadata. In concrete terms, I propose removing properties like ArrayV2Metadata.chunk_grid
, and instead moving that logic to the AsyncArray
class.