Uh oh!
There was an error while loading. Please reload this page.
document update as inplace - #4932
Conversation
dcherian
commented
Feb 20, 2021
I think we should warn for a while before removing the return value. |
keewis
commented
Feb 20, 2021
how would we do that? As far as I can tell the only options are: always warn (but that would also warn if the return value is not used) or wrap in a custom object and warn in |
:embarassed: I didn't think of that. Maybe we make the breaking change in v1.0? could add a "pending deprecation" message in the docstring? |
keewis
commented
Feb 21, 2021
I added the deprecation to both the docstring and |
max-sixty
commented
Feb 22, 2021
LGTM! Your call on ETA — |
max-sixty
commented
Feb 22, 2021
I was on the fence about doing the release this evening anyway — I may as well wait until we're decided and this is merged — I'll complete in the next couple of days. |
Could we modify the original classDataset(...)
_from_update=Falsedefupdate(self, other: "CoercibleMapping") ->"Dataset":
merge_result=dataset_update_method(self, other)
self._replace(inplace=True, **merge_result._asdict())
out=self.copy()
out._from_update=Truereturnoutdef__getattr__(self, name: str) ->Any:
ifself._from_update:
warnings.warn("")
self._from_update=Falsereturnsuper().__getattr__(name) |
keewis
commented
Feb 22, 2021
that could work, but we would need to use |
keewis
commented
Feb 22, 2021
if we decide the overhead introduced by @mathause's suggestion is worth it, I can try adding that. Does not have to be in this PR (or included in the release), though. |
let's include this in the release, even though we still have to decide if we should use the |
* upstream/master: (46 commits) pin netCDF4=1.5.3 in min-all-deps (pydata#4982) fix matplotlib errors for single level discrete colormaps (pydata#4256) Adapt exception handling in CFTimeIndex.__sub__ and __rsub__ (pydata#5006) Update options.py (pydata#5000) Adjust tests to use updated pandas syntax for offsets (pydata#4537) add a combine_attrs parameter to Dataset.merge (pydata#4895) Support for dask.graph_manipulation (pydata#4965) raise on passing axis to Dataset.reduce methods (pydata#4940) Whatsnew for 0.17.1 (pydata#4963) Refinements to how-to-release (pydata#4964) DOC: add example for reindex (pydata#4956) DOC: rm np import (pydata#4949) Add 0.17.0 release notes (pydata#4953) document update as inplace (pydata#4932) bump the dependencies (pydata#4942) Upstream CI: limit runtime (pydata#4946) typing for numpy 1.20 (pydata#4878) Use definition of DTypeLike from Numpy if found (pydata#4941) autoupdate mypy (pydata#4943) Add DataArrayCoarsen.reduce and DatasetCoarsen.reduce methods (pydata#4939) ...
As pointed out in #2951 I don't think we are able to deprecate the return value. If we are fine with introducing the breaking change in 0.17, I can also remove the return value here.
pre-commit run --all-fileswhats-new.rst