Skip to content

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

Open
@DimitriPapadopoulos

Description

@DimitriPapadopoulos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions