Skip to content

Commit

Permalink
Just assert
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Feb 13, 2024
1 parent ad10722 commit cc505c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions xarray/namedarray/parallelcompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from abc import ABC, abstractmethod
from collections.abc import Iterable, Sequence
from importlib.metadata import EntryPoint, entry_points
from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, Protocol, TypeVar
from typing import TYPE_CHECKING, Any, Callable, Generic, Protocol, TypeVar

import numpy as np

Expand Down Expand Up @@ -121,7 +121,7 @@ def guess_chunkmanager(
)


def get_chunked_array_type(*args: Any) -> Optional[ChunkManagerEntrypoint[Any]]:
def get_chunked_array_type(*args: Any) -> ChunkManagerEntrypoint[Any] | None:
"""
Detects which parallel backend should be used for given set of arrays.
Expand Down
5 changes: 1 addition & 4 deletions xarray/tests/test_parallelcompat.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ def test_raise_if_no_arrays_chunked(self, register_dummy_chunkmanager) -> None:
def test_raise_if_no_matching_chunkmanagers(self) -> None:
dummy_arr = DummyChunkedArray([1, 2, 3])

with pytest.raises(
TypeError, match="Could not find a Chunk Manager which recognises"
):
get_chunked_array_type(dummy_arr)
assert get_chunked_array_type(dummy_arr) is None

@requires_dask
def test_detect_dask_if_installed(self) -> None:
Expand Down

0 comments on commit cc505c7

Please sign in to comment.