gidgethub / gidgethub

An async GitHub API library for Python

Home Page:https://gidgethub.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[mypy] Incorrect type for argument `data` to `httpx.AsyncClient.request`

dhruvmanila opened this issue · comments

Incorrect annotation for argument data to httpx.AsyncClient.request as referenced in #74 (comment)

Location in the module: gidgethub/httpx.py::GitHubAPI::_request(body: bytes = b"")

Reference:
httpx client module: https://github.com/encode/httpx/blob/master/httpx/_client.py#L1334
Type source: https://github.com/encode/httpx/blob/master/httpx/_types.py#L73

gidgethub/httpx.py:19: error: Argument "data" to "request" of "AsyncClient" has incompatible type "bytes"; expected "Dict[Any, Any]"

https://www.python-httpx.org/api/ suggests the argument should be content, not data for httpx.