diff --git a/doc/whats-new.rst b/doc/whats-new.rst index ca172a3a85a..2b1e1c354eb 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -116,6 +116,8 @@ Bug Fixes - Fix :py:meth:`Dataset.interp` silently dropping datetime64 and timedelta64 variables, through enabling their interpolation (:issue:`10900`, :pull:`11081`). By `Emmanuel Ferdman `_. +- :func:`combine_by_coords` no longer returns an empty dataset when a generator is passed as ``data_objects`` (:issue:`10114`, :pull:`11265`). + By `Amartya Anand `_. Documentation ~~~~~~~~~~~~~ diff --git a/xarray/structure/combine.py b/xarray/structure/combine.py index e8e973683d0..6699b32d8fa 100644 --- a/xarray/structure/combine.py +++ b/xarray/structure/combine.py @@ -1074,6 +1074,8 @@ def combine_by_coords( Finally, if you attempt to combine a mix of unnamed DataArrays with either named DataArrays or Datasets, a ValueError will be raised (as this is an ambiguous operation). """ + data_objects = list(data_objects) + if any(isinstance(data_object, DataTree) for data_object in data_objects): raise NotImplementedError( "combine_by_coords() does not yet support DataTree objects."