Skip to content

Commit

Permalink
Update test_namedarray.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Aug 5, 2024
1 parent 31e1895 commit 30f8cdd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xarray/tests/test_namedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ def test_duck_array_class_array_api(self) -> None:
arrayapi_a = nxp.asarray([2.1, 4], dtype=nxp.int64)
check_duck_array_typevar(arrayapi_a)

def test_pd_index_duckarray() -> None:
import pandas as pd

a: duckarray = pd.Index([])
check_duck_array_typevar(a)

def test_new_namedarray(self) -> None:
dtype_float = np.dtype(np.float32)
narr_float: NamedArray[Any, np.dtype[np.float32]]
Expand Down Expand Up @@ -561,6 +567,3 @@ def test_broadcast_to_errors(
def test_warn_on_repeated_dimension_names(self) -> None:
with pytest.warns(UserWarning, match="Duplicate dimension names"):
NamedArray(("x", "x"), np.arange(4).reshape(2, 2))

def test_pd_index_duckarray() -> None:
a: duckarray = pd.Index([])

0 comments on commit 30f8cdd

Please sign in to comment.