From d50a5e5122d71078bcf311d54beed652506080cb Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:11:03 -0700 Subject: [PATCH 1/3] Rename `reset_encoding` to `drop_encoding` (#8287) * Rename `reset_encoding` to `drop_encoding` Closes #8259 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update dataarray.py Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update xarray/core/dataarray.py Co-authored-by: Michael Niklas * Update xarray/core/variable.py Co-authored-by: Michael Niklas * Update xarray/core/dataset.py Co-authored-by: Michael Niklas * api --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com> Co-authored-by: Michael Niklas --- doc/api-hidden.rst | 2 +- doc/api.rst | 4 ++-- doc/user-guide/io.rst | 6 +++--- doc/whats-new.rst | 7 ++++++- xarray/core/dataarray.py | 8 +++++++- xarray/core/dataset.py | 8 +++++++- xarray/core/variable.py | 6 ++++++ xarray/tests/test_dataarray.py | 4 ++-- xarray/tests/test_dataset.py | 4 ++-- xarray/tests/test_variable.py | 6 +++--- 10 files changed, 39 insertions(+), 16 deletions(-) diff --git a/doc/api-hidden.rst b/doc/api-hidden.rst index d97c4010528..552d11a06dc 100644 --- a/doc/api-hidden.rst +++ b/doc/api-hidden.rst @@ -265,7 +265,7 @@ Variable.dims Variable.dtype Variable.encoding - Variable.reset_encoding + Variable.drop_encoding Variable.imag Variable.nbytes Variable.ndim diff --git a/doc/api.rst b/doc/api.rst index 0cf07f91df8..96b4864804f 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -110,9 +110,9 @@ Dataset contents Dataset.drop_indexes Dataset.drop_duplicates Dataset.drop_dims + Dataset.drop_encoding Dataset.set_coords Dataset.reset_coords - Dataset.reset_encoding Dataset.convert_calendar Dataset.interp_calendar Dataset.get_index @@ -303,8 +303,8 @@ DataArray contents DataArray.drop_vars DataArray.drop_indexes DataArray.drop_duplicates + DataArray.drop_encoding DataArray.reset_coords - DataArray.reset_encoding DataArray.copy DataArray.convert_calendar DataArray.interp_calendar diff --git a/doc/user-guide/io.rst b/doc/user-guide/io.rst index 2ffc25b2009..ffded682035 100644 --- a/doc/user-guide/io.rst +++ b/doc/user-guide/io.rst @@ -260,12 +260,12 @@ Note that all operations that manipulate variables other than indexing will remove encoding information. In some cases it is useful to intentionally reset a dataset's original encoding values. -This can be done with either the :py:meth:`Dataset.reset_encoding` or -:py:meth:`DataArray.reset_encoding` methods. +This can be done with either the :py:meth:`Dataset.drop_encoding` or +:py:meth:`DataArray.drop_encoding` methods. .. ipython:: python - ds_no_encoding = ds_disk.reset_encoding() + ds_no_encoding = ds_disk.drop_encoding() ds_no_encoding.encoding .. _combining multiple files: diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 8f576f486dc..40c50e158ad 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -45,7 +45,12 @@ Breaking changes Deprecations ~~~~~~~~~~~~ - +- Rename :py:meth:`Dataset.reset_encoding` & :py:meth:`DataArray.reset_encoding` + to :py:meth:`Dataset.drop_encoding` & :py:meth:`DataArray.drop_encoding` for + consistency with other ``drop`` & ``reset`` methods — ``drop`` generally + removes something, while ``reset`` generally resets to some default or + standard value. (:pull:`8287`, :issue:`8259`) + By `Maximilian Roos `_. Bug fixes ~~~~~~~~~ diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index cc5d4a8744c..391b4ed9412 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -914,9 +914,15 @@ def encoding(self, value: Mapping[Any, Any]) -> None: self.variable.encoding = dict(value) def reset_encoding(self) -> Self: + warnings.warn( + "reset_encoding is deprecated since 2023.11, use `drop_encoding` instead" + ) + return self.drop_encoding() + + def drop_encoding(self) -> Self: """Return a new DataArray without encoding on the array or any attached coords.""" - ds = self._to_temp_dataset().reset_encoding() + ds = self._to_temp_dataset().drop_encoding() return self._from_temp_dataset(ds) @property diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index a1faa538564..ebd6fb6f51f 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -756,9 +756,15 @@ def encoding(self, value: Mapping[Any, Any]) -> None: self._encoding = dict(value) def reset_encoding(self) -> Self: + warnings.warn( + "reset_encoding is deprecated since 2023.11, use `drop_encoding` instead" + ) + return self.drop_encoding() + + def drop_encoding(self) -> Self: """Return a new Dataset without encoding on the dataset or any of its variables/coords.""" - variables = {k: v.reset_encoding() for k, v in self.variables.items()} + variables = {k: v.drop_encoding() for k, v in self.variables.items()} return self._replace(variables=variables, encoding={}) @property diff --git a/xarray/core/variable.py b/xarray/core/variable.py index 3baecfe5f6d..fa5523b1340 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -883,6 +883,12 @@ def encoding(self, value): raise ValueError("encoding must be castable to a dictionary") def reset_encoding(self) -> Self: + warnings.warn( + "reset_encoding is deprecated since 2023.11, use `drop_encoding` instead" + ) + return self.drop_encoding() + + def drop_encoding(self) -> Self: """Return a new Variable without encoding.""" return self._replace(encoding={}) diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index d497cd5a54d..5eb5394d58e 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -287,7 +287,7 @@ def test_encoding(self) -> None: self.dv.encoding = expected2 assert expected2 is not self.dv.encoding - def test_reset_encoding(self) -> None: + def test_drop_encoding(self) -> None: array = self.mda encoding = {"scale_factor": 10} array.encoding = encoding @@ -296,7 +296,7 @@ def test_reset_encoding(self) -> None: assert array.encoding == encoding assert array["x"].encoding == encoding - actual = array.reset_encoding() + actual = array.drop_encoding() # did not modify in place assert array.encoding == encoding diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 12347c8d62e..687aae8f1dc 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -2959,7 +2959,7 @@ def test_copy_with_data_errors(self) -> None: with pytest.raises(ValueError, match=r"contain all variables in original"): orig.copy(data={"var1": new_var1}) - def test_reset_encoding(self) -> None: + def test_drop_encoding(self) -> None: orig = create_test_data() vencoding = {"scale_factor": 10} orig.encoding = {"foo": "bar"} @@ -2967,7 +2967,7 @@ def test_reset_encoding(self) -> None: for k, v in orig.variables.items(): orig[k].encoding = vencoding - actual = orig.reset_encoding() + actual = orig.drop_encoding() assert actual.encoding == {} for k, v in actual.variables.items(): assert v.encoding == {} diff --git a/xarray/tests/test_variable.py b/xarray/tests/test_variable.py index 1ffd51f4a04..73238b6ae3a 100644 --- a/xarray/tests/test_variable.py +++ b/xarray/tests/test_variable.py @@ -473,12 +473,12 @@ def test_encoding_preserved(self): assert_identical(expected.to_base_variable(), actual.to_base_variable()) assert expected.encoding == actual.encoding - def test_reset_encoding(self) -> None: + def test_drop_encoding(self) -> None: encoding1 = {"scale_factor": 1} # encoding set via cls constructor v1 = self.cls(["a"], [0, 1, 2], encoding=encoding1) assert v1.encoding == encoding1 - v2 = v1.reset_encoding() + v2 = v1.drop_encoding() assert v1.encoding == encoding1 assert v2.encoding == {} @@ -486,7 +486,7 @@ def test_reset_encoding(self) -> None: encoding3 = {"scale_factor": 10} v3 = self.cls(["a"], [0, 1, 2], encoding=encoding3) assert v3.encoding == encoding3 - v4 = v3.reset_encoding() + v4 = v3.drop_encoding() assert v3.encoding == encoding3 assert v4.encoding == {} From 25e6e084aa18c49d92934db298a3efff9c712766 Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:06:12 -0700 Subject: [PATCH 2/3] Most of mypy 1.6.0 passing (#8296) * Most of mypy 1.6.0 passing * fix typed ops --------- Co-authored-by: Michael Niklas --- pyproject.toml | 29 +++++++-------- xarray/core/_typed_ops.py | 74 ++++++++++++++++++------------------- xarray/core/alignment.py | 16 ++++---- xarray/util/generate_ops.py | 14 ++++--- 4 files changed, 67 insertions(+), 66 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1a24a4b4eda..bdae33e4d0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ files = "xarray" show_error_codes = true show_error_context = true warn_redundant_casts = true +warn_unused_configs = true warn_unused_ignores = true # Much of the numerical computing stack doesn't have type annotations yet. @@ -168,26 +169,24 @@ module = [ # ref: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options [[tool.mypy.overrides]] # Start off with these -warn_unused_configs = true -warn_redundant_casts = true warn_unused_ignores = true # Getting these passing should be easy -strict_equality = true strict_concatenate = true +strict_equality = true # Strongly recommend enabling this one as soon as you can check_untyped_defs = true # These shouldn't be too much additional work, but may be tricky to # get passing if you use a lot of untyped libraries +disallow_any_generics = true disallow_subclassing_any = true disallow_untyped_decorators = true -disallow_any_generics = true # These next few are various gradations of forcing use of type annotations -disallow_untyped_calls = true disallow_incomplete_defs = true +disallow_untyped_calls = true disallow_untyped_defs = true # This one isn't too hard to get passing, but return on investment is lower @@ -201,12 +200,12 @@ module = ["xarray.namedarray.*", "xarray.tests.test_namedarray"] [tool.pyright] # include = ["src"] # exclude = ["**/node_modules", - # "**/__pycache__", - # "src/experimental", - # "src/typestubs" +# "**/__pycache__", +# "src/experimental", +# "src/typestubs" # ] # ignore = ["src/oldstuff"] -defineConstant = { DEBUG = true } +defineConstant = {DEBUG = true} # stubPath = "src/stubs" # venv = "env367" @@ -217,10 +216,10 @@ reportMissingTypeStubs = false # pythonPlatform = "Linux" # executionEnvironments = [ - # { root = "src/web", pythonVersion = "3.5", pythonPlatform = "Windows", extraPaths = [ "src/service_libs" ] }, - # { root = "src/sdk", pythonVersion = "3.0", extraPaths = [ "src/backend" ] }, - # { root = "src/tests", extraPaths = ["src/tests/e2e", "src/sdk" ]}, - # { root = "src" } +# { root = "src/web", pythonVersion = "3.5", pythonPlatform = "Windows", extraPaths = [ "src/service_libs" ] }, +# { root = "src/sdk", pythonVersion = "3.0", extraPaths = [ "src/backend" ] }, +# { root = "src/tests", extraPaths = ["src/tests/e2e", "src/sdk" ]}, +# { root = "src" } # ] [tool.ruff] @@ -252,16 +251,16 @@ known-first-party = ["xarray"] [tool.pytest.ini_options] addopts = ["--strict-config", "--strict-markers"] -log_cli_level = "INFO" -minversion = "7" filterwarnings = [ "ignore:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning", ] +log_cli_level = "INFO" markers = [ "flaky: flaky tests", "network: tests requiring a network connection", "slow: slow tests", ] +minversion = "7" python_files = "test_*.py" testpaths = ["xarray/tests", "properties"] diff --git a/xarray/core/_typed_ops.py b/xarray/core/_typed_ops.py index 330d13bb217..9b79ed46a9c 100644 --- a/xarray/core/_typed_ops.py +++ b/xarray/core/_typed_ops.py @@ -4,7 +4,7 @@ from __future__ import annotations import operator -from typing import TYPE_CHECKING, Any, Callable, NoReturn, overload +from typing import TYPE_CHECKING, Any, Callable, overload from xarray.core import nputils, ops from xarray.core.types import ( @@ -446,201 +446,201 @@ def _binary_op( raise NotImplementedError @overload - def __add__(self, other: T_DataArray) -> NoReturn: + def __add__(self, other: T_DataArray) -> T_DataArray: ... @overload def __add__(self, other: VarCompatible) -> Self: ... - def __add__(self, other: VarCompatible) -> Self: + def __add__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.add) @overload - def __sub__(self, other: T_DataArray) -> NoReturn: + def __sub__(self, other: T_DataArray) -> T_DataArray: ... @overload def __sub__(self, other: VarCompatible) -> Self: ... - def __sub__(self, other: VarCompatible) -> Self: + def __sub__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.sub) @overload - def __mul__(self, other: T_DataArray) -> NoReturn: + def __mul__(self, other: T_DataArray) -> T_DataArray: ... @overload def __mul__(self, other: VarCompatible) -> Self: ... - def __mul__(self, other: VarCompatible) -> Self: + def __mul__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.mul) @overload - def __pow__(self, other: T_DataArray) -> NoReturn: + def __pow__(self, other: T_DataArray) -> T_DataArray: ... @overload def __pow__(self, other: VarCompatible) -> Self: ... - def __pow__(self, other: VarCompatible) -> Self: + def __pow__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.pow) @overload - def __truediv__(self, other: T_DataArray) -> NoReturn: + def __truediv__(self, other: T_DataArray) -> T_DataArray: ... @overload def __truediv__(self, other: VarCompatible) -> Self: ... - def __truediv__(self, other: VarCompatible) -> Self: + def __truediv__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.truediv) @overload - def __floordiv__(self, other: T_DataArray) -> NoReturn: + def __floordiv__(self, other: T_DataArray) -> T_DataArray: ... @overload def __floordiv__(self, other: VarCompatible) -> Self: ... - def __floordiv__(self, other: VarCompatible) -> Self: + def __floordiv__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.floordiv) @overload - def __mod__(self, other: T_DataArray) -> NoReturn: + def __mod__(self, other: T_DataArray) -> T_DataArray: ... @overload def __mod__(self, other: VarCompatible) -> Self: ... - def __mod__(self, other: VarCompatible) -> Self: + def __mod__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.mod) @overload - def __and__(self, other: T_DataArray) -> NoReturn: + def __and__(self, other: T_DataArray) -> T_DataArray: ... @overload def __and__(self, other: VarCompatible) -> Self: ... - def __and__(self, other: VarCompatible) -> Self: + def __and__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.and_) @overload - def __xor__(self, other: T_DataArray) -> NoReturn: + def __xor__(self, other: T_DataArray) -> T_DataArray: ... @overload def __xor__(self, other: VarCompatible) -> Self: ... - def __xor__(self, other: VarCompatible) -> Self: + def __xor__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.xor) @overload - def __or__(self, other: T_DataArray) -> NoReturn: + def __or__(self, other: T_DataArray) -> T_DataArray: ... @overload def __or__(self, other: VarCompatible) -> Self: ... - def __or__(self, other: VarCompatible) -> Self: + def __or__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.or_) @overload - def __lshift__(self, other: T_DataArray) -> NoReturn: + def __lshift__(self, other: T_DataArray) -> T_DataArray: ... @overload def __lshift__(self, other: VarCompatible) -> Self: ... - def __lshift__(self, other: VarCompatible) -> Self: + def __lshift__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.lshift) @overload - def __rshift__(self, other: T_DataArray) -> NoReturn: + def __rshift__(self, other: T_DataArray) -> T_DataArray: ... @overload def __rshift__(self, other: VarCompatible) -> Self: ... - def __rshift__(self, other: VarCompatible) -> Self: + def __rshift__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.rshift) @overload - def __lt__(self, other: T_DataArray) -> NoReturn: + def __lt__(self, other: T_DataArray) -> T_DataArray: ... @overload def __lt__(self, other: VarCompatible) -> Self: ... - def __lt__(self, other: VarCompatible) -> Self: + def __lt__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.lt) @overload - def __le__(self, other: T_DataArray) -> NoReturn: + def __le__(self, other: T_DataArray) -> T_DataArray: ... @overload def __le__(self, other: VarCompatible) -> Self: ... - def __le__(self, other: VarCompatible) -> Self: + def __le__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.le) @overload - def __gt__(self, other: T_DataArray) -> NoReturn: + def __gt__(self, other: T_DataArray) -> T_DataArray: ... @overload def __gt__(self, other: VarCompatible) -> Self: ... - def __gt__(self, other: VarCompatible) -> Self: + def __gt__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.gt) @overload - def __ge__(self, other: T_DataArray) -> NoReturn: + def __ge__(self, other: T_DataArray) -> T_DataArray: ... @overload def __ge__(self, other: VarCompatible) -> Self: ... - def __ge__(self, other: VarCompatible) -> Self: + def __ge__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, operator.ge) @overload # type:ignore[override] - def __eq__(self, other: T_DataArray) -> NoReturn: + def __eq__(self, other: T_DataArray) -> T_DataArray: ... @overload def __eq__(self, other: VarCompatible) -> Self: ... - def __eq__(self, other: VarCompatible) -> Self: + def __eq__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, nputils.array_eq) @overload # type:ignore[override] - def __ne__(self, other: T_DataArray) -> NoReturn: + def __ne__(self, other: T_DataArray) -> T_DataArray: ... @overload def __ne__(self, other: VarCompatible) -> Self: ... - def __ne__(self, other: VarCompatible) -> Self: + def __ne__(self, other: VarCompatible) -> Self | T_DataArray: return self._binary_op(other, nputils.array_ne) def __radd__(self, other: VarCompatible) -> Self: diff --git a/xarray/core/alignment.py b/xarray/core/alignment.py index 7d9ba4f4b94..732ec5d3ea6 100644 --- a/xarray/core/alignment.py +++ b/xarray/core/alignment.py @@ -604,7 +604,7 @@ def align( @overload -def align( # type: ignore[misc] +def align( obj1: T_Obj1, obj2: T_Obj2, /, @@ -619,7 +619,7 @@ def align( # type: ignore[misc] @overload -def align( # type: ignore[misc] +def align( obj1: T_Obj1, obj2: T_Obj2, obj3: T_Obj3, @@ -635,7 +635,7 @@ def align( # type: ignore[misc] @overload -def align( # type: ignore[misc] +def align( obj1: T_Obj1, obj2: T_Obj2, obj3: T_Obj3, @@ -652,7 +652,7 @@ def align( # type: ignore[misc] @overload -def align( # type: ignore[misc] +def align( obj1: T_Obj1, obj2: T_Obj2, obj3: T_Obj3, @@ -1101,14 +1101,14 @@ def broadcast( @overload -def broadcast( # type: ignore[misc] +def broadcast( obj1: T_Obj1, obj2: T_Obj2, /, *, exclude: str | Iterable[Hashable] | None = None ) -> tuple[T_Obj1, T_Obj2]: ... @overload -def broadcast( # type: ignore[misc] +def broadcast( obj1: T_Obj1, obj2: T_Obj2, obj3: T_Obj3, @@ -1120,7 +1120,7 @@ def broadcast( # type: ignore[misc] @overload -def broadcast( # type: ignore[misc] +def broadcast( obj1: T_Obj1, obj2: T_Obj2, obj3: T_Obj3, @@ -1133,7 +1133,7 @@ def broadcast( # type: ignore[misc] @overload -def broadcast( # type: ignore[misc] +def broadcast( obj1: T_Obj1, obj2: T_Obj2, obj3: T_Obj3, diff --git a/xarray/util/generate_ops.py b/xarray/util/generate_ops.py index 632ca06d295..f339470884a 100644 --- a/xarray/util/generate_ops.py +++ b/xarray/util/generate_ops.py @@ -87,13 +87,15 @@ def {method}(self, other: {other_type}) -> {return_type}:{type_ignore} return self._binary_op(other, {func})""" template_binop_overload = """ @overload{overload_type_ignore} - def {method}(self, other: {overload_type}) -> NoReturn: + def {method}(self, other: {overload_type}) -> {overload_type}: ... @overload def {method}(self, other: {other_type}) -> {return_type}: ... -""" + + def {method}(self, other: {other_type}) -> {return_type} | {overload_type}:{type_ignore} + return self._binary_op(other, {func})""" template_reflexive = """ def {method}(self, other: {other_type}) -> {return_type}: return self._binary_op(other, {func}, reflexive=True)""" @@ -123,7 +125,7 @@ def {method}(self, *args: Any, **kwargs: Any) -> Self: # # We require a "hack" to tell type checkers that e.g. Variable + DataArray = DataArray # In reality this returns NotImplementes, but this is not a valid type in python 3.9. -# Therefore, we use NoReturn which mypy seems to recognise! +# Therefore, we return DataArray. In reality this would call DataArray.__add__(Variable) # TODO: change once python 3.10 is the minimum. # # Mypy seems to require that __iadd__ and __add__ have the same signature. @@ -165,7 +167,7 @@ def binops_overload( ([(None, None)], required_method_binary, extras), ( BINOPS_NUM + BINOPS_CMP, - template_binop_overload + template_binop, + template_binop_overload, extras | { "overload_type": overload_type, @@ -175,7 +177,7 @@ def binops_overload( ), ( BINOPS_EQNE, - template_binop_overload + template_binop, + template_binop_overload, extras | { "overload_type": overload_type, @@ -233,7 +235,7 @@ def unops() -> list[OpsType]: from __future__ import annotations import operator -from typing import TYPE_CHECKING, Any, Callable, NoReturn, overload +from typing import TYPE_CHECKING, Any, Callable, overload from xarray.core import nputils, ops from xarray.core.types import ( From 338fc9268a1ea41dbb861906fdf2e79d939e2df3 Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:00:47 -0700 Subject: [PATCH 3/3] xfail flaky test (#8299) * xfail flaky test Would be better to fix it, but in lieu of fixing, better to skip it * . --- xarray/tests/test_backends.py | 1 + 1 file changed, 1 insertion(+) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 0cbf3af3664..9ec67bf47dc 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -3459,6 +3459,7 @@ def skip_if_not_engine(engine): @requires_dask @pytest.mark.filterwarnings("ignore:use make_scale(name) instead") +@pytest.mark.xfail(reason="Flaky test. Very open to contributions on fixing this") def test_open_mfdataset_manyfiles( readengine, nfiles, parallel, chunks, file_cache_maxsize ):