Registry Mirror
Skip to content

Conversation

@Yagnik-Trivedi

@Yagnik-Trivedi Yagnik-Trivedi commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes the "Small cleanups" item from the deprecation tracker in #11721:

  • Dataset.argmax() warning said argmin (copy-paste from argmin). Both messages were also missing a space, producing "no argument,since".
  • reset_encoding warned with a plain UserWarning and said "deprecated since 2023.11", but it shipped in v2023.10.0. It now uses FutureWarning, like the other deprecations, with the correct version. This is the only change that alters behaviour: filters on FutureWarning now catch it, and filters on UserWarning no longer do.
  • cftime_range docstring cited .. deprecated:: 2025.02.0, which was never released; it is now 2025.03.0.
  • Leftover global warnings filter: decode_cf_variables called warnings.filterwarnings("once", "decode_timedelta", FutureWarning) on every decode, permanently modifying the user's global warning filters. The deprecation it served was finalized in Finalize change in behavior of decode_timedelta=None #11173, so it is removed (along with the now-unused import warnings).
  • TreeNode.lineage warned twice, because it returned self.iter_lineage(), which is itself deprecated. It now builds the tuple directly.

Tests: one regression test per behavioural fix (reset_encoding on Dataset/DataArray/Variable, the argmin/argmax message, lineage warning exactly once, decode_cf leaving warnings.filters unchanged). All 9 fail on main and pass here. The full test suite passes locally apart from tests needing scipy/pyarrow, which aren't installed in my environment and fail identically on main.

Checklist

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Claude Code (Claude Opus 5.5). I chose this item from Tracking: open deprecations #11721; the agent located each issue, wrote the fixes and tests, and wrote this description at my direction.

Yagnik-Trivedi and others added 2 commits October 13, 2026 20:28
From the "small cleanups" list in pydata#11721:

- Dataset.argmax() without dim warned about argmin (copy-paste), and
  both messages were missing a space before "since".
- reset_encoding warned with a plain UserWarning and named the wrong
  version; use FutureWarning and 2023.10, when it actually shipped.
- cftime_range's docstring cited the unreleased 2025.02.0.
- decode_cf_variables installed a global "once" warnings filter for the
  decode_timedelta deprecation, which was finalized in pydata#11173.
- TreeNode.lineage warned twice by calling the deprecated iter_lineage.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
@Yagnik-Trivedi

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #11724, which was opened first. Sorry for the overlap!

[This is Claude Code on behalf of Yagnik Trivedi]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant