File tree 2 files changed +5
-13
lines changed
2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -4157,7 +4157,7 @@ def unstack(
4157
4157
result = result ._unstack_once (dim , fill_value )
4158
4158
return result
4159
4159
4160
- def update (self , other : "CoercibleMapping" ) -> "Dataset" :
4160
+ def update (self , other : "CoercibleMapping" ) -> None :
4161
4161
"""Update this dataset's variables with those from another dataset.
4162
4162
4163
4163
Just like :py:meth:`dict.update` this is a in-place operation.
@@ -4173,14 +4173,6 @@ def update(self, other: "CoercibleMapping") -> "Dataset":
4173
4173
- mapping {var name: (dimension name, array-like)}
4174
4174
- mapping {var name: (tuple of dimension names, array-like)}
4175
4175
4176
- Returns
4177
- -------
4178
- updated : Dataset
4179
- Updated dataset. Note that since the update is in-place this is the input
4180
- dataset.
4181
-
4182
- It is deprecated since version 0.17 and scheduled to be removed in 0.19.
4183
-
4184
4176
Raises
4185
4177
------
4186
4178
ValueError
@@ -4192,7 +4184,7 @@ def update(self, other: "CoercibleMapping") -> "Dataset":
4192
4184
Dataset.assign
4193
4185
"""
4194
4186
merge_result = dataset_update_method (self , other )
4195
- return self ._replace (inplace = True , ** merge_result ._asdict ())
4187
+ self ._replace (inplace = True , ** merge_result ._asdict ())
4196
4188
4197
4189
def merge (
4198
4190
self ,
Original file line number Diff line number Diff line change @@ -3191,13 +3191,13 @@ def test_update(self):
3191
3191
data = create_test_data (seed = 0 )
3192
3192
expected = data .copy ()
3193
3193
var2 = Variable ("dim1" , np .arange (8 ))
3194
- actual = data .update ({"var2" : var2 })
3194
+ actual = data
3195
+ actual .update ({"var2" : var2 })
3195
3196
expected ["var2" ] = var2
3196
3197
assert_identical (expected , actual )
3197
3198
3198
3199
actual = data .copy ()
3199
- actual_result = actual .update (data )
3200
- assert actual_result is actual
3200
+ actual .update (data )
3201
3201
assert_identical (expected , actual )
3202
3202
3203
3203
other = Dataset (attrs = {"new" : "attr" })
You can’t perform that action at this time.
0 commit comments