Skip to content

Commit f01f9bb

Browse files
DimitriPapadopoulosd-v-b
authored andcommitted
Enable and apply ruff rule RUF009 (#1941)
RUF009 Do not perform function call `cast` in dataclass defaults
1 parent 87c97ba commit f01f9bb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ extend-select = [
177177
ignore = [
178178
"RUF003",
179179
"RUF005",
180-
"RUF009",
181180
"RUF012",
182181
"RUF015",
183182
]

src/zarr/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from collections.abc import Iterable
66
from dataclasses import dataclass, field, replace
77
from enum import Enum
8-
from typing import TYPE_CHECKING, Any, cast
8+
from typing import TYPE_CHECKING, Any
99

1010
import numpy as np
1111
import numpy.typing as npt
@@ -312,7 +312,7 @@ class ArrayV2Metadata(ArrayMetadata):
312312
filters: list[dict[str, JSON]] | None = None
313313
dimension_separator: Literal[".", "/"] = "."
314314
compressor: dict[str, JSON] | None = None
315-
attributes: dict[str, JSON] = cast(dict[str, JSON], field(default_factory=dict))
315+
attributes: dict[str, JSON] = field(default_factory=dict)
316316
zarr_format: Literal[2] = field(init=False, default=2)
317317

318318
def __init__(

0 commit comments

Comments
 (0)