Skip to content

Handle non-JSON Cloud Query error responses - #3118

Merged
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/assess-mock-features
Aug 4, 2026
Merged

Handle non-JSON Cloud Query error responses#3118
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/assess-mock-features

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • raise a response-carrying CloudRecoError for documented empty or non-JSON Cloud Query 4xx responses
  • cover both sync and async clients using the new forced-failure support in vws-python-mock==2026.8.4.1
  • remove the obsolete direct PyTorch development dependencies now that the mock uses OpenCV

The mock support was merged in vws-python-mock#3315 and released by workflow run 30913240037.

Validation

  • pytest: 325 passed with 100% coverage
  • all pre-commit and manual hooks
  • all pre-push hooks, including mypy, pyright, pyrefly, ty, and package checks

Closes #3093


Note

Low Risk
Localized error-handling change in Cloud Query with matching tests; dependency cleanup only affects dev/test installs.

Overview
Cloud Query sync and async clients now treat documented 4xx responses with empty or non-JSON bodies as CloudRecoError (with the HTTP response attached) instead of surfacing JSONDecodeError. Parsing is centralized in a single response_body load; successful responses with invalid JSON still raise JSONDecodeError.

Dev tooling drops explicit PyTorch/torchvision pins and the CPU PyTorch uv index, and bumps vws-python-mock to 2026.8.4.1 so tests can force Cloud Query failures via CloudQueryFailureResponse. New tests cover empty and arbitrary-text 4xx bodies plus malformed 200 responses for both clients.

Reviewed by Cursor Bugbot for commit f8344ed. Bugbot is set up for automated code reviews on this repo. Configure here.

@adamtheturtle
adamtheturtle marked this pull request as ready for review August 4, 2026 15:12
@adamtheturtle
adamtheturtle merged commit e166888 into main Aug 4, 2026
14 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/assess-mock-features branch August 4, 2026 15:27
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.

Cloud query clients raise JSONDecodeError for documented empty 4xx responses

1 participant