Skip to content

Commit 4bc134a

Browse files
Apply ruff/flake8-pyi rule PYI051
PYI051 `Literal["..."]` is redundant in a union with `str`
1 parent 8cd0e1a commit 4bc134a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

xarray/backends/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
T_NetcdfEngine = Literal["netcdf4", "scipy", "h5netcdf"]
7272
T_Engine = Union[
7373
T_NetcdfEngine,
74-
Literal["pydap", "zarr"],
74+
Literal["pydap", "zarr"], # noqa: PYI051
7575
type[BackendEntrypoint],
7676
str, # no nice typing support for custom backends
7777
None,

xarray/core/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def copy(
214214

215215
# FYI in some cases we don't allow `None`, which this doesn't take account of.
216216
# FYI the `str` is for a size string, e.g. "16MB", supported by dask.
217-
T_ChunkDim: TypeAlias = str | int | Literal["auto"] | None | tuple[int, ...]
217+
T_ChunkDim: TypeAlias = int | Literal["auto"] | None | tuple[int, ...]
218218
T_ChunkDimFreq: TypeAlias = Union["TimeResampler", T_ChunkDim]
219219
T_ChunksFreq: TypeAlias = T_ChunkDim | Mapping[Any, T_ChunkDimFreq]
220220
# We allow the tuple form of this (though arguably we could transition to named dims only)

xarray/namedarray/_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def dtype(self) -> _DType_co: ...
7878
_NormalizedChunks = tuple[tuple[int, ...], ...]
7979
# FYI in some cases we don't allow `None`, which this doesn't take account of.
8080
# # FYI the `str` is for a size string, e.g. "16MB", supported by dask.
81-
T_ChunkDim: TypeAlias = str | int | Literal["auto"] | None | tuple[int, ...]
81+
T_ChunkDim: TypeAlias = int | Literal["auto"] | None | tuple[int, ...]
8282
# We allow the tuple form of this (though arguably we could transition to named dims only)
8383
T_Chunks: TypeAlias = T_ChunkDim | Mapping[Any, T_ChunkDim]
8484

0 commit comments

Comments
 (0)