Skip to content

how to abstract over v2 / v3 metadata differences #3080

Open
@d-v-b

Description

@d-v-b

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions