Skip to content

Fix apis-integ's 4 Pyright errors without changing the requests the tests send #876

Closed

Description

@anth-volk

Problem

projects/policyengine-apis-integ has 4 Pyright errors, tolerated by rules/baselines/pyright-apis-integ.txt (sim.quality.pyright-apis-integ, #864). The generated client types the four endpoints that declare bearer authentication (submit and poll, for annual and budget-window runs) as taking only an AuthenticatedClient. The integration tests pass Client | AuthenticatedClient: a plain Client, sending no Authorization header, when no access token is configured, which is how they run against local services in CI.

Constraint

The fix must not change which headers the tests send, and must use no suppression or cast.

Proposal

Call those endpoints through small test-support functions. Each sends exactly what the endpoint's sync_detailed sends (the module's _get_kwargs, through the client's own httpx client, parsed by _build_response), but accepts either client. Pin that with a test that records the requests. Then make the rule enforced and delete the baseline.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions