Skip to content

Commit 8592c6d

Browse files
committed
Fix a FutureWarning from xarray around timedelta decoding
xarray will in the future stop automatically decoding timedelta variables. It has added a FutureWarning about this. This warning was causing the latest dependency CI checks to fail. This particular test is specifically about timedelta handling, so we want to opt in to decoding timedelta values.
1 parent fbe02db commit 8592c6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/masking/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_find_fill_value_timedelta_with_missing_value(
112112
dataset_path, 'var',
113113
numpy.array([[0, 1], [2, missing_value]], dtype=numpy.float32))
114114

115-
with xarray.open_dataset(dataset_path) as dataset:
115+
with xarray.open_dataset(dataset_path, decode_timedelta=True) as dataset:
116116
data_array = dataset['var']
117117
assert dataset['var'].dtype == numpy.dtype('timedelta64[ns]')
118118
fill_value = masking.find_fill_value(data_array)

0 commit comments

Comments
 (0)