From 30f8cddcb8ebe03b7bd271212aaad4f469c32faa Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:08:25 +0200 Subject: [PATCH] Update test_namedarray.py --- xarray/tests/test_namedarray.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xarray/tests/test_namedarray.py b/xarray/tests/test_namedarray.py index c9b63d0d518..0d813cc7a8f 100644 --- a/xarray/tests/test_namedarray.py +++ b/xarray/tests/test_namedarray.py @@ -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]] @@ -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([])