Skip to content

Commit 5b9b6c4

Browse files
Apply ruff/flake8-bandit rule B006 (#2049)
1 parent 48e2475 commit 5b9b6c4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/zarr/group.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def create(
123123
cls,
124124
store: StoreLike,
125125
*,
126-
attributes: dict[str, Any] = {}, # noqa: B006, FIXME
126+
attributes: dict[str, Any] | None = None,
127127
exists_ok: bool = False,
128128
zarr_format: ZarrFormat = 3,
129129
) -> AsyncGroup:
@@ -133,6 +133,7 @@ async def create(
133133
assert not await (store_path / ZARR_JSON).exists()
134134
elif zarr_format == 2:
135135
assert not await (store_path / ZGROUP_JSON).exists()
136+
attributes = attributes or {}
136137
group = cls(
137138
metadata=GroupMetadata(attributes=attributes, zarr_format=zarr_format),
138139
store_path=store_path,
@@ -311,8 +312,9 @@ async def create_group(
311312
self,
312313
path: str,
313314
exists_ok: bool = False,
314-
attributes: dict[str, Any] = {}, # noqa: B006, FIXME
315+
attributes: dict[str, Any] | None = None,
315316
) -> AsyncGroup:
317+
attributes = attributes or {}
316318
return await type(self).create(
317319
self.store_path / path,
318320
attributes=attributes,
@@ -490,10 +492,11 @@ def create(
490492
cls,
491493
store: StoreLike,
492494
*,
493-
attributes: dict[str, Any] = {}, # noqa: B006, FIXME
495+
attributes: dict[str, Any] | None = None,
494496
zarr_format: ZarrFormat = 3,
495497
exists_ok: bool = False,
496498
) -> Group:
499+
attributes = attributes or {}
497500
obj = sync(
498501
AsyncGroup.create(
499502
store,

0 commit comments

Comments
 (0)