From 5b9b6c42da27f33f0b43c0560539f35a96b1766f Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:11:26 +0200 Subject: [PATCH] Apply ruff/flake8-bandit rule B006 (#2049) --- src/zarr/group.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/zarr/group.py b/src/zarr/group.py index 5cf0e48db..a42d52d96 100644 --- a/src/zarr/group.py +++ b/src/zarr/group.py @@ -123,7 +123,7 @@ async def create( cls, store: StoreLike, *, - attributes: dict[str, Any] = {}, # noqa: B006, FIXME + attributes: dict[str, Any] | None = None, exists_ok: bool = False, zarr_format: ZarrFormat = 3, ) -> AsyncGroup: @@ -133,6 +133,7 @@ async def create( assert not await (store_path / ZARR_JSON).exists() elif zarr_format == 2: assert not await (store_path / ZGROUP_JSON).exists() + attributes = attributes or {} group = cls( metadata=GroupMetadata(attributes=attributes, zarr_format=zarr_format), store_path=store_path, @@ -311,8 +312,9 @@ async def create_group( self, path: str, exists_ok: bool = False, - attributes: dict[str, Any] = {}, # noqa: B006, FIXME + attributes: dict[str, Any] | None = None, ) -> AsyncGroup: + attributes = attributes or {} return await type(self).create( self.store_path / path, attributes=attributes, @@ -490,10 +492,11 @@ def create( cls, store: StoreLike, *, - attributes: dict[str, Any] = {}, # noqa: B006, FIXME + attributes: dict[str, Any] | None = None, zarr_format: ZarrFormat = 3, exists_ok: bool = False, ) -> Group: + attributes = attributes or {} obj = sync( AsyncGroup.create( store,