Skip to content

Build typed multipart query fields - #3629

Merged
adamtheturtle merged 1 commit into
mainfrom
cleanup-query-multipart-type
Sep 12, 2026
Merged

adamtheturtle merged 1 commit into
mainfrom
cleanup-query-multipart-type

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

The query test helper passed heterogeneous multipart tuples directly to urllib3. Some fields intentionally contain integers and booleans, which urllib3 accepts at runtime but excludes from its annotated field value type; the helper therefore widened the whole mapping to explicit Any and suppressed Pyrefly.

Keep object only at the heterogeneous test-data boundary, validate each value against the actual supported scalar domain, normalize numeric values to their wire strings, and construct urllib3’s public RequestField objects before encoding. This removes the explicit Any and ignore without relying on a cast or another reflective escape hatch.

Validation:

  • all configured pre-commit hooks
  • all configured pre-push hooks (Mypy, Pyright, Pyrefly, Ty, verifytypes, docs, manifest and partition checks)
  • full non-real-backend suite: 1,948 passed, 843 skipped

The changed test module reports 99% locally only because two pre-existing branches skip mock-specific ordering assertions on the separately partitioned real backend. The new multipart construction lines are covered; CI combines the configured partitions and remains the authoritative 100% gate.

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