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
4 changes: 4 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ New Features
Breaking changes
~~~~~~~~~~~~~~~~

- :py:meth:`Dataset.update` now returns ``None``, instead of the updated dataset. This
completes the deprecation cycle started in version 0.17. The method still updates the
dataset in-place. (:issue:`10167`)
By `Maximilian Roos <https://github.com/max-sixty>`_.

Deprecations
~~~~~~~~~~~~
Expand Down
12 changes: 2 additions & 10 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5592,7 +5592,7 @@ def unstack(
result = result._unstack_once(d, stacked_indexes[d], fill_value, sparse)
return result

def update(self, other: CoercibleMapping) -> Self:
def update(self, other: CoercibleMapping) -> None:
"""Update this dataset's variables with those from another dataset.

Just like :py:meth:`dict.update` this is a in-place operation.
Expand All @@ -5609,14 +5609,6 @@ def update(self, other: CoercibleMapping) -> Self:
- mapping {var name: (dimension name, array-like)}
- mapping {var name: (tuple of dimension names, array-like)}

Returns
-------
updated : Dataset
Updated dataset. Note that since the update is in-place this is the input
dataset.

It is deprecated since version 0.17 and scheduled to be removed in 0.21.

Raises
------
ValueError
Expand All @@ -5629,7 +5621,7 @@ def update(self, other: CoercibleMapping) -> Self:
Dataset.merge
"""
merge_result = dataset_update_method(self, other)
return self._replace(inplace=True, **merge_result._asdict())
self._replace(inplace=True, **merge_result._asdict())

def merge(
self,
Expand Down
Loading