Skip to content

Relax nanosecond datetime restriction in CF time decoding #18404

Relax nanosecond datetime restriction in CF time decoding

Relax nanosecond datetime restriction in CF time decoding #18404

GitHub Actions / Test Results failed Dec 16, 2024 in 0s

25 fail, 2 318 skipped, 19 347 pass in 1h 21m 39s

     11 files  ±0       11 suites  ±0   1h 21m 39s ⏱️ + 2m 42s
 21 690 tests ±0   19 347 ✅  -  25   2 318 💤 ±0   25 ❌ + 25 
185 321 runs  ±0  160 498 ✅  - 229  24 594 💤 ±0  229 ❌ +229 

Results for commit a16a890. ± Comparison against earlier commit 53fe43a.

Annotations

Check warning on line 0 in xarray.tests.test_backends.TestNetCDF4Data

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestNetCDF4Data)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestNetCDF4Data object at 0x7ffb7fff32c0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestScipyInMemoryData

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestScipyInMemoryData)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestScipyInMemoryData object at 0x7fbff8eeaae0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestScipyFileObject

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestScipyFileObject)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestScipyFileObject object at 0x7fbffa24a930>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestNetCDF4ViaDaskData

See this annotation in the file changed.

@github-actions github-actions / Test Results

8 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestNetCDF4ViaDaskData)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestNetCDF4ViaDaskData object at 0x7ffb7fcfa870>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestScipyFilePath

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestScipyFilePath)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestScipyFilePath object at 0x7fbffa23a750>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_conventions.TestCFEncodedDataStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_conventions.TestCFEncodedDataStore)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_conventions.TestCFEncodedDataStore object at 0x7fc767ee7aa0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestNetCDF3ViaNetCDF4Data

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestNetCDF3ViaNetCDF4Data)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestNetCDF3ViaNetCDF4Data object at 0x7fbffa202300>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 9 runs failed: test_roundtrip_empty_vlen_string_array[2] (xarray.tests.test_backends.TestZarrDictStore)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7ffb7fd29bb0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_conventions

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_encode_cf_variable_with_vlen_dtype (xarray.tests.test_conventions)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

    def test_encode_cf_variable_with_vlen_dtype() -> None:
        v = Variable(
            ["x"], np.array(["a", "b"], dtype=coding.strings.create_vlen_dtype(str))
        )
        encoded_v = conventions.encode_cf_variable(v)
        assert encoded_v.data.dtype.kind == "O"
        assert coding.strings.check_vlen_dtype(encoded_v.data.dtype) is str
    
        # empty array
>       v = Variable(["x"], np.array([], dtype=coding.strings.create_vlen_dtype(str)))

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_conventions.py#x1B[0m:653: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:382: in __init__
    dims=dims, data=as_compatible_data(data, fastpath=fastpath), attrs=attrs
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestNetCDF4ClassicViaNetCDF4Data

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestNetCDF4ClassicViaNetCDF4Data)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestNetCDF4ClassicViaNetCDF4Data object at 0x7fbffa229220>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestGenericNetCDFData

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestGenericNetCDFData)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestGenericNetCDFData object at 0x7fbff9f915e0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestZarrDirectoryStore

See this annotation in the file changed.

@github-actions github-actions / Test Results

7 out of 9 runs failed: test_roundtrip_empty_vlen_string_array[2] (xarray.tests.test_backends.TestZarrDirectoryStore)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestZarrDirectoryStore object at 0x7ffb7ed45910>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestH5NetCDFData

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestH5NetCDFData)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestH5NetCDFData object at 0x7fbff9f5a330>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestZarrWriteEmpty

See this annotation in the file changed.

@github-actions github-actions / Test Results

7 out of 9 runs failed: test_roundtrip_empty_vlen_string_array[2] (xarray.tests.test_backends.TestZarrWriteEmpty)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestZarrWriteEmpty object at 0x7ffb7ece64e0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestH5NetCDFFileObject

See this annotation in the file changed.

@github-actions github-actions / Test Results

9 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestH5NetCDFFileObject)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestH5NetCDFFileObject object at 0x7fbff9f9ec60>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_backends.TestH5NetCDFViaDaskData

See this annotation in the file changed.

@github-actions github-actions / Test Results

8 out of 10 runs failed: test_roundtrip_empty_vlen_string_array (xarray.tests.test_backends.TestH5NetCDFViaDaskData)

artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
KeyError: 0
self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
>               return self._range.index(new_key)
#x1B[1m#x1B[31mE               ValueError: 0 is not in range#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:413: ValueError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

self = <xarray.tests.test_backends.TestH5NetCDFViaDaskData object at 0x7fbff9f979e0>

    def test_roundtrip_empty_vlen_string_array(self) -> None:
        # checks preserving vlen dtype for empty arrays GH7862
        dtype = create_vlen_dtype(str)
>       original = Dataset({"a": np.array([], dtype=dtype)})

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_backends.py#x1B[0m:931: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:747: in __init__
    variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/dataset.py#x1B[0m:460: in merge_data_and_coords
    return merge_core(
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:699: in merge_core
    collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/merge.py#x1B[0m:358: in collect_variables_and_indexes
    variable = as_variable(variable, name=name, auto_convert=False)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:165: in as_variable
    data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:300: in as_compatible_data
    data = _possibly_convert_objects(data)
#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/core/variable.py#x1B[0m:222: in _possibly_convert_objects
    and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1121: in __getitem__
    return self._get_value(key)
#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/series.py#x1B[0m:1237: in _get_value
    loc = self.index.get_loc(label)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = RangeIndex(start=0, stop=0, step=1), key = 0

    @doc(Index.get_loc)
    def get_loc(self, key) -> int:
        if is_integer(key) or (is_float(key) and key.is_integer()):
            new_key = int(key)
            try:
                return self._range.index(new_key)
            except ValueError as err:
>               raise KeyError(key) from err
#x1B[1m#x1B[31mE               KeyError: 0#x1B[0m

#x1B[1m#x1B[31m/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError

Check warning on line 0 in xarray.tests.test_variable.TestVariable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_datetime64_conversion_scalar[values1-s] (xarray.tests.test_variable.TestVariable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<M8[ns]') == dtype('<M8[s]')
 +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype
 +  and   dtype('<M8[s]') = <class 'numpy.dtype'>('datetime64[s]')
 +    where <class 'numpy.dtype'> = np.dtype
self = <xarray.tests.test_variable.TestVariable object at 0x7ffb65d07c20>
values = Timestamp('2000-01-01 00:00:00'), unit = 's'

    @pytest.mark.filterwarnings("ignore:Converting non-default")
    @pytest.mark.parametrize(
        "values, unit",
        [
            (np.datetime64("2000-01-01"), "s"),
            (pd.Timestamp("2000-01-01T00"), "s"),
            (datetime(2000, 1, 1), "us"),
        ],
    )
    def test_datetime64_conversion_scalar(self, values, unit):
        # todo: check, if this test is OK
        v = Variable([], values)
>       assert v.dtype == np.dtype(f"datetime64[{unit}]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<M8[ns]') == dtype('<M8[s]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<M8[s]') = <class 'numpy.dtype'>('datetime64[s]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:1096: AssertionError

Check warning on line 0 in xarray.tests.test_variable.TestVariable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_datetime64_conversion_scalar[values2-us] (xarray.tests.test_variable.TestVariable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<M8[ns]') == dtype('<M8[us]')
 +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype
 +  and   dtype('<M8[us]') = <class 'numpy.dtype'>('datetime64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
self = <xarray.tests.test_variable.TestVariable object at 0x7ffb65d07f50>
values = datetime.datetime(2000, 1, 1, 0, 0), unit = 'us'

    @pytest.mark.filterwarnings("ignore:Converting non-default")
    @pytest.mark.parametrize(
        "values, unit",
        [
            (np.datetime64("2000-01-01"), "s"),
            (pd.Timestamp("2000-01-01T00"), "s"),
            (datetime(2000, 1, 1), "us"),
        ],
    )
    def test_datetime64_conversion_scalar(self, values, unit):
        # todo: check, if this test is OK
        v = Variable([], values)
>       assert v.dtype == np.dtype(f"datetime64[{unit}]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<M8[ns]') == dtype('<M8[us]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<M8[us]') = <class 'numpy.dtype'>('datetime64[us]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:1096: AssertionError

Check warning on line 0 in xarray.tests.test_variable.TestVariable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_timedelta64_conversion_scalar[values1-us] (xarray.tests.test_variable.TestVariable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')
 +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(86400000000000, dtype='timedelta64[ns]').dtype
 +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
self = <xarray.tests.test_variable.TestVariable object at 0x7ffb65c87380>
values = Timedelta('1 days 00:00:00'), unit = 'us'

    @pytest.mark.filterwarnings("ignore:Converting non-default")
    @pytest.mark.parametrize(
        "values, unit",
        [
            (np.timedelta64(1, "D"), "s"),
            (pd.Timedelta("1 day"), "us"),
            (timedelta(days=1), "us"),
        ],
    )
    def test_timedelta64_conversion_scalar(self, values, unit):
        # todo: discussion needed
        # todo: check, if this test is OK
        v = Variable([], values)
>       assert v.dtype == np.dtype(f"timedelta64[{unit}]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(86400000000000, dtype='timedelta64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:1113: AssertionError

Check warning on line 0 in xarray.tests.test_variable.TestVariable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_timedelta64_conversion_scalar[values2-us] (xarray.tests.test_variable.TestVariable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')
 +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(86400000000000, dtype='timedelta64[ns]').dtype
 +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
self = <xarray.tests.test_variable.TestVariable object at 0x7ffb65c87110>
values = datetime.timedelta(days=1), unit = 'us'

    @pytest.mark.filterwarnings("ignore:Converting non-default")
    @pytest.mark.parametrize(
        "values, unit",
        [
            (np.timedelta64(1, "D"), "s"),
            (pd.Timedelta("1 day"), "us"),
            (timedelta(days=1), "us"),
        ],
    )
    def test_timedelta64_conversion_scalar(self, values, unit):
        # todo: discussion needed
        # todo: check, if this test is OK
        v = Variable([], values)
>       assert v.dtype == np.dtype(f"timedelta64[{unit}]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(86400000000000, dtype='timedelta64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:1113: AssertionError

Check warning on line 0 in xarray.tests.test_variable.TestVariable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_0d_datetime (xarray.tests.test_variable.TestVariable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<M8[ns]') == dtype('<M8[s]')
 +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype
 +  and   dtype('<M8[s]') = <class 'numpy.dtype'>('datetime64[s]')
 +    where <class 'numpy.dtype'> = np.dtype
self = <xarray.tests.test_variable.TestVariable object at 0x7ffb65c87890>

    def test_0d_datetime(self):
        # todo: check, if this test is OK
        v = Variable([], pd.Timestamp("2000-01-01"))
>       assert v.dtype == np.dtype("datetime64[s]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<M8[ns]') == dtype('<M8[s]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<M8[s]') = <class 'numpy.dtype'>('datetime64[s]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:1129: AssertionError

Check warning on line 0 in xarray.tests.test_variable.TestVariable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_0d_timedelta[values0-us] (xarray.tests.test_variable.TestVariable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')
 +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(1000000000, dtype='timedelta64[ns]').dtype
 +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
self = <xarray.tests.test_variable.TestVariable object at 0x7ffb65c87ef0>
values = Timedelta('0 days 00:00:01'), unit = 'us'

    @pytest.mark.filterwarnings("ignore:Converting non-default")
    @pytest.mark.parametrize(
        "values, unit", [(pd.to_timedelta("1s"), "us"), (np.timedelta64(1, "s"), "s")]
    )
    def test_0d_timedelta(self, values, unit):
        # todo: check, if this test is OK
        v = Variable([], values)
>       assert v.dtype == np.dtype(f"timedelta64[{unit}]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(1000000000, dtype='timedelta64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:1139: AssertionError

Check warning on line 0 in xarray.tests.test_variable.TestAsCompatibleData

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_datetime (xarray.tests.test_variable.TestAsCompatibleData)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<M8[us]') == dtype('<M8[ns]')
 +  where dtype('<M8[us]') = <class 'numpy.dtype'>('datetime64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
 +  and   dtype('<M8[ns]') = array('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype
self = <xarray.tests.test_variable.TestAsCompatibleData object at 0x7fbfe4313aa0>

    @pytest.mark.filterwarnings("ignore:Converting non-default")
    def test_datetime(self):
        # todo: check, if this test is OK
        expected = np.datetime64("2000-01-01")
        actual = as_compatible_data(expected)
        assert expected == actual
        assert np.ndarray is type(actual)
        assert np.dtype("datetime64[s]") == actual.dtype
    
        expected = np.array([np.datetime64("2000-01-01")])
        actual = as_compatible_data(expected)
        assert np.asarray(expected) == actual
        assert np.ndarray is type(actual)
        assert np.dtype("datetime64[s]") == actual.dtype
    
        expected = np.array([np.datetime64("2000-01-01", "ns")])
        actual = as_compatible_data(expected)
        assert np.asarray(expected) == actual
        assert np.ndarray is type(actual)
        assert np.dtype("datetime64[ns]") == actual.dtype
        assert expected is source_ndarray(np.asarray(actual))
    
        expected = np.datetime64("2000-01-01", "us")
        actual = as_compatible_data(datetime(2000, 1, 1))
        assert np.asarray(expected) == actual
        assert np.ndarray is type(actual)
>       assert np.dtype("datetime64[us]") == actual.dtype
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<M8[us]') == dtype('<M8[ns]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<M8[us]') = <class 'numpy.dtype'>('datetime64[us]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<M8[ns]') = array('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:2682: AssertionError

Check warning on line 0 in xarray.tests.test_variable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_datetime_conversion_warning[2000-01-01 00:00:00-us] (xarray.tests.test_variable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<M8[ns]') == dtype('<M8[us]')
 +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype
 +  and   dtype('<M8[us]') = <class 'numpy.dtype'>('datetime64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
values = datetime.datetime(2000, 1, 1, 0, 0), unit = 'us'

    @pytest.mark.parametrize(
        ("values", "unit"),
        [
            (np.datetime64("2000-01-01", "ns"), "ns"),
            (np.datetime64("2000-01-01", "s"), "s"),
            (np.array([np.datetime64("2000-01-01", "ns")]), "ns"),
            (np.array([np.datetime64("2000-01-01", "s")]), "s"),
            (pd.date_range("2000", periods=1), "ns"),
            (datetime(2000, 1, 1), "us"),
            (np.array([datetime(2000, 1, 1)]), "ns"),
            (pd.date_range("2000", periods=1, tz=pytz.timezone("America/New_York")), "ns"),
            (
                pd.Series(
                    pd.date_range("2000", periods=1, tz=pytz.timezone("America/New_York"))
                ),
                "ns",
            ),
        ],
        ids=lambda x: f"{x}",
    )
    def test_datetime_conversion_warning(values, unit) -> None:
        # todo: needs discussion
        # todo: check, if this test is OK
        dims = ["time"] if isinstance(values, np.ndarray | pd.Index | pd.Series) else []
        var = Variable(dims, values)
        if var.dtype.kind == "M":
>           assert var.dtype == np.dtype(f"datetime64[{unit}]")
#x1B[1m#x1B[31mE           AssertionError: assert dtype('<M8[ns]') == dtype('<M8[us]')#x1B[0m
#x1B[1m#x1B[31mE            +  where dtype('<M8[ns]') = <xarray.Variable ()> Size: 8B\narray('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE            +  and   dtype('<M8[us]') = <class 'numpy.dtype'>('datetime64[us]')#x1B[0m
#x1B[1m#x1B[31mE            +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:3023: AssertionError

Check warning on line 0 in xarray.tests.test_variable

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 10 runs failed: test_timedelta_conversion_warning[1 day, 0:00:00-us] (xarray.tests.test_variable)

artifacts/Test results for Linux-3.10 bare-minimum/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10 min-all-deps/pytest.xml [took 0s]
artifacts/Test results for Linux-3.10/pytest.xml [took 0s]
artifacts/Test results for Linux-3.11 all-but-dask/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12 all-but-numba/pytest.xml [took 0s]
artifacts/Test results for Linux-3.12/pytest.xml [took 0s]
artifacts/Test results for Windows-3.10/pytest.xml [took 0s]
artifacts/Test results for Windows-3.12/pytest.xml [took 0s]
artifacts/Test results for macOS-3.10/pytest.xml [took 0s]
artifacts/Test results for macOS-3.12/pytest.xml [took 0s]
Raw output
AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')
 +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(86400000000000, dtype='timedelta64[ns]').dtype
 +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')
 +    where <class 'numpy.dtype'> = np.dtype
values = datetime.timedelta(days=1), unit = 'us'

    @pytest.mark.parametrize(
        ("values", "unit"),
        [
            (np.timedelta64(10, "ns"), "ns"),
            (np.timedelta64(10, "s"), "s"),
            (np.array([np.timedelta64(10, "ns")]), "ns"),
            (np.array([np.timedelta64(10, "s")]), "s"),
            (pd.timedelta_range("1", periods=1), "ns"),
            (timedelta(days=1), "us"),
            (np.array([timedelta(days=1)]), "ns"),
            (pd.timedelta_range("1", periods=1).astype("timedelta64[s]"), "s"),
        ],
        ids=lambda x: f"{x}",
    )
    def test_timedelta_conversion_warning(values, unit) -> None:
        dims = ["time"] if isinstance(values, np.ndarray | pd.Index) else []
        var = Variable(dims, values)
>       assert var.dtype == np.dtype(f"timedelta64[{unit}]")
#x1B[1m#x1B[31mE       AssertionError: assert dtype('<m8[ns]') == dtype('<m8[us]')#x1B[0m
#x1B[1m#x1B[31mE        +  where dtype('<m8[ns]') = <xarray.Variable ()> Size: 8B\narray(86400000000000, dtype='timedelta64[ns]').dtype#x1B[0m
#x1B[1m#x1B[31mE        +  and   dtype('<m8[us]') = <class 'numpy.dtype'>('timedelta64[us]')#x1B[0m
#x1B[1m#x1B[31mE        +    where <class 'numpy.dtype'> = np.dtype#x1B[0m

#x1B[1m#x1B[31m/home/runner/work/xarray/xarray/xarray/tests/test_variable.py#x1B[0m:3091: AssertionError