Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/misc/test_xarray_timedelta_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_xarray_timedelta_units_unsafe_cast(
dataset.to_netcdf(tmp_path / "period.nc")


@only_versions('xarray >= 2024.02.0')
@only_versions('xarray >= 2024.02.0, < 2025.03.0')
def test_xarray_timedelta_units_cast_runtimewarning(
tmp_path: pathlib.Path,
):
Expand All @@ -69,9 +69,12 @@ def test_xarray_timedelta_units_cast_runtimewarning(
when casting a data array with dtype timedelta64 to int16
if it contains NaT (not a time) values.

This check was later refactored out in favour of something more robust.

See also
========
https://github.com/pydata/xarray/issues/9134
https://github.com/pydata/xarray/pull/9498
"""
dataset = make_dataset()
message = "Not possible to cast encoded times from dtype('int64') to dtype('int16') without overflow."
Expand Down
6 changes: 4 additions & 2 deletions tests/operations/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def test_cache_key_with_multifile_dataset_ugrid_mesh2d(datasets: pathlib.Path):

dataset_paths = [ugrid_path1, ugrid_path2]

multifile_dataset = xarray.open_mfdataset(dataset_paths, data_vars=['values'])
multifile_dataset = xarray.open_mfdataset(
dataset_paths, data_vars=['values'], compat='no_conflicts')

multifile_ds_hash = hashlib.sha1()

Expand All @@ -230,7 +231,8 @@ def test_cache_key_with_multifile_dataset_cfgrid2d(datasets: pathlib.Path):

dataset_paths = [cfgrid_path1, cfgrid_path2]

multifile_dataset = xarray.open_mfdataset(dataset_paths, data_vars=['values'])
multifile_dataset = xarray.open_mfdataset(
dataset_paths, data_vars=['values'], compat='no_conflicts')

multifile_ds_hash = hashlib.sha1()

Expand Down
Loading