Skip to content

AsyncGroup.create_dataset() might call AsyncGroup.create_array() without dtype argument #3050

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

Open
DimitriPapadopoulos opened this issue May 8, 2025 · 0 comments · May be fixed by #3059
Open
Labels
bug Potential issues with the zarr-python library

Comments

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented May 8, 2025

Zarr version

main branch

Description

AsyncGroup.create_array() arguments shape and dtype have no default value, so they are mandatory:

async def create_array(
self,
name: str,
*,
shape: ShapeLike,
dtype: npt.DTypeLike,
chunks: ChunkCoords | Literal["auto"] = "auto",

As far as I can see, AsyncGroup.create_dataset() may call AsyncGroup.create_array() without dtype argument if kwargs is missing dtype and data is None:

if "dtype" not in kwargs and data is not None:
kwargs["dtype"] = data.dtype
array = await self.create_array(name, shape=shape, **kwargs)

Granted, that wouldn't make sense, but it would be better to handle that corner case nicely.

@DimitriPapadopoulos DimitriPapadopoulos added the bug Potential issues with the zarr-python library label May 8, 2025
@DimitriPapadopoulos DimitriPapadopoulos changed the title AsyncGroup.create_dataset() might call AsyncGroup.create_array() without dtype argument AsyncGroup.create_dataset() might call AsyncGroup.create_array() without dtype argument May 8, 2025
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