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

[v3]: Add Store method for getting the size of an item. #2420

Open
TomAugspurger opened this issue Oct 20, 2024 · 0 comments · May be fixed by #2426
Open

[v3]: Add Store method for getting the size of an item. #2420

TomAugspurger opened this issue Oct 20, 2024 · 0 comments · May be fixed by #2426
Labels
bug Potential issues with the zarr-python library

Comments

@TomAugspurger
Copy link
Contributor

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

@TomAugspurger TomAugspurger added the bug Potential issues with the zarr-python library label Oct 20, 2024
TomAugspurger added a commit to TomAugspurger/zarr-python that referenced this issue Oct 21, 2024
@TomAugspurger TomAugspurger linked a pull request Oct 21, 2024 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

1 participant