From b1f065b4d0f371bbc0b9ee2eb3ebfdba1da464e2 Mon Sep 17 00:00:00 2001 From: Thomas Nicholas Date: Mon, 13 Jan 2020 14:48:16 +0000 Subject: [PATCH 1/2] Added DataArray as valid type input to ds.merge method --- xarray/core/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 6ecd9b59f8e..dd999355aae 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3550,7 +3550,7 @@ def update(self, other: "CoercibleMapping", inplace: bool = None) -> "Dataset": def merge( self, - other: "CoercibleMapping", + other: Union["CoercibleMapping", DataArray], inplace: bool = None, overwrite_vars: Union[Hashable, Iterable[Hashable]] = frozenset(), compat: str = "no_conflicts", From 42397c05c51bbb3a7a211a592e2c833d91721c62 Mon Sep 17 00:00:00 2001 From: Thomas Nicholas Date: Mon, 13 Jan 2020 14:57:04 +0000 Subject: [PATCH 2/2] Fix import error by specifying type as string --- xarray/core/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index dd999355aae..2d15ff586e4 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -3550,7 +3550,7 @@ def update(self, other: "CoercibleMapping", inplace: bool = None) -> "Dataset": def merge( self, - other: Union["CoercibleMapping", DataArray], + other: Union["CoercibleMapping", "DataArray"], inplace: bool = None, overwrite_vars: Union[Hashable, Iterable[Hashable]] = frozenset(), compat: str = "no_conflicts",