Relax nanosecond datetime restriction in CF time decoding #18405
25 fail, 2 318 skipped, 19 347 pass in 1h 21m 37s
Annotations
Check warning on line 0 in xarray.tests.test_backends.TestScipyInMemoryData
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E9518C9DC0>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestScipyFileObject
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E9518E2270>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestNetCDF4Data
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x0000023145991430>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestScipyFilePath
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E9517379E0>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestNetCDF3ViaNetCDF4Data
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E950837560>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestNetCDF4ClassicViaNetCDF4Data
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E95089AF00>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestNetCDF4ViaDaskData
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x0000023145CAD250>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestGenericNetCDFData
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E9508B6D80>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestH5NetCDFData
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E9508DEF90>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestZarrDictStore
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x0000023146CD4470>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestH5NetCDFFileObject
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E9508FA9F0>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestZarrDirectoryStore
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.11/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 0x7faf3392d790>
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.11/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.11/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.11/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestZarrWriteEmpty
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.11/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 0x7faf35809110>
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.11/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.11/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.11/site-packages/pandas/core/indexes/range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_backends.TestH5NetCDFViaDaskData
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x000001E952982D50>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_conventions.TestCFEncodedDataStore
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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 0x0000026144D4FBF0>
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[31mD:\a\xarray\xarray\xarray\tests\test_backends.py#x1B[0m:931:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:747: in __init__
variables, coord_names, dims, indexes, _ = merge_data_and_coords(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\dataset.py#x1B[0m:460: in merge_data_and_coords
return merge_core(
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\merge.py#x1B[0m:699: in merge_core
collected = collect_variables_and_indexes(aligned, indexes=indexes)
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:165: in as_variable
data: T_DuckArray = as_compatible_data(obj)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_conventions
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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mD:\a\xarray\xarray\xarray\tests\test_conventions.py#x1B[0m:653:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mD:\a\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[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:300: in as_compatible_data
data = _possibly_convert_objects(data)
#x1B[1m#x1B[31mD:\a\xarray\xarray\xarray\core\variable.py#x1B[0m:222: in _possibly_convert_objects
and isinstance(as_series[0], datetime | pd.Timestamp)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\series.py#x1B[0m:1121: in __getitem__
return self._get_value(key)
#x1B[1m#x1B[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\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[31mC:\Users\runneradmin\micromamba\envs\xarray-tests\Lib\site-packages\pandas\core\indexes\range.py#x1B[0m:415: KeyError
Check warning on line 0 in xarray.tests.test_variable.TestVariable
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 0x000002614957D490>
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:1096: AssertionError
Check warning on line 0 in xarray.tests.test_variable.TestVariable
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 0x000002614957C080>
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:1096: AssertionError
Check warning on line 0 in xarray.tests.test_variable.TestVariable
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 0x000002614957FF20>
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:1113: AssertionError
Check warning on line 0 in xarray.tests.test_variable.TestVariable
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 0x000002614957FD10>
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:1113: AssertionError
Check warning on line 0 in xarray.tests.test_variable.TestVariable
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 0x0000026149572450>
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:1129: AssertionError
Check warning on line 0 in xarray.tests.test_variable.TestVariable
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 0x00000261495706B0>
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:1139: AssertionError
Check warning on line 0 in xarray.tests.test_variable.TestAsCompatibleData
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 0x0000018294058CE0>
@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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:2682: AssertionError
Check warning on line 0 in xarray.tests.test_variable
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:3023: AssertionError
Check warning on line 0 in xarray.tests.test_variable
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[31mD:\a\xarray\xarray\xarray\tests\test_variable.py#x1B[0m:3091: AssertionError