-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document update as inplace #4932
Conversation
I think we should warn for a while before removing the return value. |
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? |
I added the deprecation to both the docstring and |
LGTM! Your call on ETA — |
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 class Dataset(...)
_from_update = False
def update(self, other: "CoercibleMapping") -> "Dataset":
merge_result = dataset_update_method(self, other)
self._replace(inplace=True, **merge_result._asdict())
out = self.copy()
out._from_update = True
return out
def __getattr__(self, name: str) -> Any:
if self._from_update:
warnings.warn("")
self._from_update = False
return super().__getattr__(name) |
that could work, but we would need to use |
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-files
whats-new.rst