Skip to content

Group.create_array signature doesn't match between sync and async #2112

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

Closed
TomAugspurger opened this issue Aug 23, 2024 · 2 comments · Fixed by #2132
Closed

Group.create_array signature doesn't match between sync and async #2112

TomAugspurger opened this issue Aug 23, 2024 · 2 comments · Fixed by #2132
Labels
bug Potential issues with the zarr-python library
Milestone

Comments

@TomAugspurger
Copy link
Contributor

Zarr version

v3

Numcodecs version

na

Python Version

na

Operating System

na

Installation

na

Description

The signature for AsyncGroup.create_array differs from Group.create_array.

Async:

    async def create_array(
        self,
        path: str,
        shape: ChunkCoords,

and sync

    def create_array(
        self,
        name: str,
        *,
        shape: ChunkCoords,

Steps to reproduce

n/a

Additional output

Do we want these to match in general? If so, it might be worth writing a simple pre-commit hook to check that the signatures match between the two objects.

And in this specific case, is path or name correct?

@TomAugspurger TomAugspurger added the bug Potential issues with the zarr-python library label Aug 23, 2024
@jhamman
Copy link
Member

jhamman commented Aug 23, 2024

Yes, we want these to match and it looks like the sync version is the one we want in this case (that is name is the arg we want).

In general, our sync wrappers would really benefit from some automation (ala [sychronicity](https://github.com/modal-labs/synchronicity or asyncer.runnify). In 95% of cases, the args/docstring are going to be identical so we can probably auto create the sync versions.

@jhamman
Copy link
Member

jhamman commented Aug 28, 2024

PR up addressing this here: #2132

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
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants