Skip to content

Wip 0.4.5#112

Merged
dpieski merged 7 commits intomainfrom
wip-0.4.5
Mar 11, 2026
Merged

Wip 0.4.5#112
dpieski merged 7 commits intomainfrom
wip-0.4.5

Conversation

@dpieski
Copy link
Copy Markdown
Contributor

@dpieski dpieski commented Mar 11, 2026

Description

Refactor BaseUSPTOClient request methods to eliminate polymorphic return types. The branch splits _make_request (returning dict | T) into three single-return-type methods:

  • _stream_requestrequests.Response (first commit)
  • _get_modelT (second commit)
  • _get_jsondict[str, Any] (second commit)

Also adds include_raw_data parameter to DocumentBag.from_dict, StatusCodeSearchResponse.from_dict, and PetitionDecisionDownloadResponse.from_dict for FromDictProtocol conformance, enabling them to use _get_model directly. Fixes PTAB appeals integration test query (AppealREGULAR for applicationTypeCategory).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this manually (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

  • 28 call sites migrated across 6 client files: 26 to _get_model, 2 to _get_json (get_search_results POST/GET which do custom list parsing with no top-level model)
  • All assert isinstance / # type: ignore workarounds removed from client code
  • 100% test coverage
  • All example scripts pass
  • All integration tests pass
  • All changes are internal (_ methods), so no public API impact

@dpieski dpieski merged commit 987d271 into main Mar 11, 2026
7 checks passed
@dpieski dpieski deleted the wip-0.4.5 branch March 12, 2026 15:07
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