Skip to content
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

Warn ignored keep attrs #5265

Merged
merged 3 commits into from
May 6, 2021
Merged

Conversation

mathause
Copy link
Collaborator

@mathause mathause commented May 6, 2021

This PR warns when passing keep_attrs to resample(..., keep_attrs=True) and rolling_exp(..., keep_attrs=True) as they have no effect (rightfully). Also removes keep_attrs from the docstring of resample.

doc/whats-new.rst Outdated Show resolved Hide resolved
@@ -926,6 +926,14 @@ def rolling_exp(
--------
core.rolling_exp.RollingExp
"""

if "keep_attrs" in window_kwargs:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if I should warn here. Nobody ever complained. However, all other functions either warn (from a deprection) or error (because keep_atttrs is not a valid keyword).

Copy link
Collaborator

@max-sixty max-sixty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dcherian
Copy link
Contributor

dcherian commented May 6, 2021

Thanks @mathause

@dcherian dcherian merged commit 477fc2f into pydata:master May 6, 2021
dcherian added a commit to matzegoebel/xarray that referenced this pull request May 13, 2021
* upstream/master: (23 commits)
  combine keep_attrs and combine_attrs in apply_ufunc (pydata#5041)
  Explained what a deprecation cycle is (pydata#5289)
  Code cleanup (pydata#5234)
  FacetGrid docstrings (pydata#5293)
  Add whats new for dataset interpolation with non-numerics (pydata#5297)
  Allow dataset interpolation with different datatypes (pydata#5008)
  Flexible indexes: add Index base class and xindexes properties (pydata#5102)
  pre-commit: autoupdate hook versions (pydata#5280)
  convert the examples for apply_ufunc to doctest (pydata#5279)
  fix the new whatsnew section
  Ensure `HighLevelGraph` layers are `Layer` instances (pydata#5271)
  New whatsnew section
  Release-workflow: Bug fix (pydata#5273)
  more maintenance on whats-new.rst (pydata#5272)
  v0.18.0 release highlights (pydata#5266)
  Fix exception when display_expand_data=False for file-backed array. (pydata#5235)
  Warn ignored keep attrs (pydata#5265)
  Disable workflows on forks (pydata#5267)
  fix the built wheel test (pydata#5270)
  pypi upload workflow maintenance (pydata#5269)
  ...
@mathause mathause deleted the warn_ignored_keep_attrs branch October 18, 2021 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants