Skip to content

feat: return a useful value from CodecPipeline.read() - #3828

Merged
d-v-b merged 4 commits into
zarr-developers:mainfrom
d-v-b:feat/getresult
Mar 25, 2026
Merged

feat: return a useful value from CodecPipeline.read()#3828
d-v-b merged 4 commits into
zarr-developers:mainfrom
d-v-b:feat/getresult

Conversation

@d-v-b

Copy link
Copy Markdown
Contributor

This PR adds GetResult, a TypedDict, to zarr.abc.codec. GetResult has 1 field: status, which can be either "present" or "missing". CodecPipeline.read return a tuple of GetResult objects, one per chunk.

In its current form, this allows a caller of CodecPipeline.read() to know which chunks where present, and which were missing, which will be useful for #3748, where this idea emerged. More broadly, returning useful information about IO is something we should do more, which is why GetResult is a simple, extensible TypedDict class which we can build on later.

d-v-b added 2 commits March 24, 2026 21:58
This type is a typeddict that stores information about a completed
attempt to fetch a stored resource, e.g. a chunk. Currently, `GetResult`
only stores whether the resource was present or missing. We can add more capacity
to this type in the future.
@github-actionsgithub-actionsBot added the needs release notes Automatically applied to PRs which haven't added release notes label Mar 24, 2026
@d-v-b
d-v-b requested a review from maxrjonesMarch 24, 2026 21:03
@github-actionsgithub-actionsBot removed the needs release notes Automatically applied to PRs which haven't added release notes label Mar 24, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@d-v-b@maxrjones