Skip to content

numcodecs warn on read #3832

Closed
Closed

Description

@slevang

I think it's not very good user experience to spam with warnings when reading a non-spec codec e.g. from numcodecs. The warning on write makes sense, but currently there is no way for an end user to read a numcodecs store without warnings.

import warnings
import zarr
from zarr.codecs import numcodecs

warnings.simplefilter("always")

# Warns on both write and read
a = zarr.create_array({}, shape=(10,), chunks=(10,), dtype="uint8", compressors=[numcodecs.Zstd(level=1)])
zarr.open_array(a.store, mode="r")

Activity

  1. d-v-b commented on Mar 25, 2026

    @d-v-b
    Contributor

    I kind of do think it's important to warn people when they are reading from data that's off-spec. Maybe we can do that in a less annoying way?

  2. d-v-b commented on Mar 25, 2026

    @d-v-b
    Contributor

    fwiw my preferred approach for reducing the warnings is to write specs for these codecs

  3. slevang commented on Mar 25, 2026

    @slevang
    ContributorAuthor

    imo for someone creating data, the warning is reasonable. It says "use these at your own risk, they're not fully supported everywhere". For a data user, what can they possibly do with this warning? The existence of the store is usually out of their control, and they just want to read it.

  4. d-v-b commented on Mar 25, 2026

    @d-v-b
    Contributor

    For a data user, what can they possibly do with this warning? The existence of the store is usually out of their control, and they just want to read it.

    I think when we added these warnings, we anticipated making breaking changes that would break the ability to read from data saved with these codecs. But realistically, we can pretty easily be permissible about what stuff we support for reading -- we can always make breaking changes to writing behavior, but read the old data -- so I think re-evaluating our warning strategy here makes sense.

  5. added
    choreMaintenance work
    spec complianceRelated to the library's compliance with the Zarr specifications
    on Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance workspec complianceRelated to the library's compliance with the Zarr specifications

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions