Skip to content

Dispatch DELETE in do_request - #28

Merged
tomchop merged 1 commit into
mainfrom
feat/do-request-delete
Sep 29, 2026
Merged

tomchop merged 1 commit into
mainfrom
feat/do-request-delete

Conversation

@tomchop

@tomchop tomchop commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

do_request dispatched GET, POST and PATCH and raised ValueError: Unsupported method: DELETE for anything else. That is the reason the 2.3.0 notes had to say "No delete_agent_persona: do_request dispatches GET, POST and PATCH only", and the reason there is no delete_dfiq either.

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 the YetiApiError wrapping 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. Adding delete_dfiq, delete_agent_persona and 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 to Session.delete, and an unknown method still raises)
  • poetry run pyrefly check — 0 errors

Also driven against a live Yeti, creating a DFIQ scenario and deleting it through the wrapper:

created: 17361959
do_request("DELETE") returned: b'null'
still there? False

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.

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.
@tomchop
tomchop merged commit 235bd20 into main Sep 29, 2026
3 checks passed
@tomchop
tomchop deleted the feat/do-request-delete branch October 4, 2026 09:33
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.

1 participant