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

Change get_range start and end parameters to be kwarg only, add length as alternative #155

Closed
kylebarron opened this issue Jan 16, 2025 · 1 comment · Fixed by #156
Closed

Comments

@kylebarron
Copy link
Member

Many libraries use either start/end or offset/length for range requests. We should require these params to be keyword-only params.

Additionally, we should allow length as a named parameter (exclusive with end), for ease of use

This would be a breaking change. Sadly I just released 0.3, so this would require an 0.4.

@maxrjones
Copy link
Member

FWIW I did not find that there is a significant performance cost to using dataclasses for a range requests in addition to suffix and offset requests in https://github.com/maxrjones/zarr-byterangerequest-microbenchmarks/blob/main/plot-results.ipynb, as long as you use if; then syntax rather than match; case. That was the motivation for moving to only using dataclasses in zarr-developers/zarr-python#2585. Norman suggested this possible design for supporting length as well. It would be simple to run similar tests specifically for obstore if helpful.

But, requiring kwargs would similarly avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants