Dispatch DELETE in do_request - #28
Merged
Merged
Conversation
do_request raised ValueError("Unsupported method: DELETE") for anything but
GET, POST and PATCH, so no client method could delete an object and callers
had to reach past the wrapper into self.client. That also skipped the 401
refresh-and-retry and the YetiApiError wrapping that every other call gets.
No delete_* convenience methods yet; this only removes what blocked them.
Version bumped to 2.4.0 so the release can be cut without a second commit
on main.
This was referenced Oct 2, 2026
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.
do_requestdispatched GET, POST and PATCH and raisedValueError: Unsupported method: DELETEfor anything else. That is the reason the 2.3.0 notes had to say "Nodelete_agent_persona:do_requestdispatches GET, POST and PATCH only", and the reason there is nodelete_dfiqeither.The practical effect is worse than a missing method: anyone needing to delete has to reach past the wrapper into
self.client, which skips the 401 refresh-and-retry and theYetiApiErrorwrapping that every other call gets. I hit this cleaning up after a live test of #27.Scope
Two lines of dispatch. No
delete_*convenience methods — this only removes what was blocking them. Addingdelete_dfiq,delete_agent_personaand friends is a separate question about which deletions the client should expose.Verification
Unit and type checks, run the way CI does via
poetry install --no-root:poetry run python -m unittest tests/api.py— 39 passed (2 new: DELETE dispatches toSession.delete, and an unknown method still raises)poetry run pyrefly check— 0 errorsAlso driven against a live Yeti, creating a DFIQ scenario and deleting it through the wrapper:
Release
Version bumped to 2.4.0 — additive behaviour on a public method, so a minor. As with 2.3.1 the bump rides in here so no second commit has to land on protected
main; the tag and published release are still a separate step, and there is no urgency to cut one.