Repository navigation
Conversation
Reject unsupported errors values rather than silently ignoring missing names. Cover Dataset and DataArray drop_vars/drop_indexes and DataTree.drop_nodes. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Dataset.drop_vars,Dataset.drop_indexesandDataTree.drop_nodesonly checked whethererrorswas"raise". Any other value, including a typo such aserrors="raises", was treated like"ignore", so missing names were skipped without a word.drop,drop_selanddrop_dimsalready raise aValueErrorfor an invaliderrorsvalue. This PR adds the same check, with the same message, to the three methods that were missing it.DataArray.drop_varsandDataArray.drop_indexesuse the Dataset methods, so they are covered too.I added
test_drop_invalid_errors(Dataset and DataArray) andtest_drop_nodes_invalid_errors(DataTree), and a note inwhats-new.rst. The 30 new test cases fail onmainand pass with this change. The three affected test files pass (1443 passed, 55 skipped, 10 xfailed, 2 xpassed), andruffreports nothing.Checklist
whats-new.rstAI Disclosure
Tools: Claude Code. It wrote the fix and tests at my direction. I read the diff and can explain each change.