8000 [v3]: Add Store method for getting the size of an item. · Issue #2420 · zarr-developers/zarr-python · GitHub
[go: up one dir, main page]

Skip to content
8000
[v3]: Add Store method for getting the size of an item. #2420
Closed
@TomAugspurger

Description

@TomAugspurger

Zarr version

v3

Numcodecs version

n/a

Python Version

n/a

Operating System

n/a

Installation

n/a

Description

In #2400, we need a method for getting the size of some object from a Store to support .info. The cleanest way to do this is a new method in the Store API.

We could implement an inefficient version that basically does

def size(self, key: str) -> int:
    return len(await self.get(key))

Many backends will have more efficient methods for getting the size of a file / object without actually reading it.

Steps to reproduce

.

Additional output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0