File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ Deprecations
79
79
For now using ``dim `` issues a ``FutureWarning ``. It will be removed in
80
80
version 0.19.0 (:pull: `3993 `).
81
81
By `Tom Nicholas <https://github.com/TomNicholas >`_.
82
+ - the return value of :py:meth: `Dataset.update ` is being deprecated to make it work more
83
+ like :py:meth: `dict.update `. It will be removed in version 0.19.0 (:pull: `4932 `).
84
+ By `Justus Magin <https://github.com/keewis >`_.
82
85
83
86
84
87
New Features
@@ -181,6 +184,8 @@ Documentation
181
184
- add concat examples and improve combining documentation (:issue: `4620 `, :pull: `4645 `).
182
185
By `Ray Bell <https://github.com/raybellwaves >`_ and
183
186
`Justus Magin <https://github.com/keewis >`_.
187
+ - explicitly mention that :py:meth: `Dataset.update ` updates inplace (:issue: `2951 `, :pull: `4932 `).
188
+ By `Justus Magin <https://github.com/keewis >`_.
184
189
185
190
Internal Changes
186
191
~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -3865,6 +3865,8 @@ def unstack(
3865
3865
def update (self , other : "CoercibleMapping" ) -> "Dataset" :
3866
3866
"""Update this dataset's variables with those from another dataset.
3867
3867
3868
+ Just like :py:meth:`dict.update` this is a in-place operation.
3869
+
3868
3870
Parameters
3869
3871
----------
3870
3872
other : Dataset or mapping
@@ -3879,13 +3881,20 @@ def update(self, other: "CoercibleMapping") -> "Dataset":
3879
3881
Returns
3880
3882
-------
3881
3883
updated : Dataset
3882
- Updated dataset.
3884
+ Updated dataset. Note that since the update is in-place this is the input
3885
+ dataset.
3886
+
3887
+ It is deprecated since version 0.17 and scheduled to be removed in 0.19.
3883
3888
3884
3889
Raises
3885
3890
------
3886
3891
ValueError
3887
3892
If any dimensions would have inconsistent sizes in the updated
3888
3893
dataset.
3894
+
3895
+ See Also
3896
+ --------
3897
+ Dataset.assign
3889
3898
"""
3890
3899
merge_result = dataset_update_method (self , other )
3891
3900
return self ._replace (inplace = True , ** merge_result ._asdict ())
You can’t perform that action at this time.
0 commit comments