You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When instrumenting httpx clients e.g. via HTTPXClientInstrumentor.instrument_client, users can pass request_hook and response_hook callables which accept namedtuples RequestInfo/ResponseInfo (type definitions). These tuples contain a header field typed as Optional[List[Tuple[bytes, bytes]]]. However, at runtime this field seems to be copied verbatim from request.headers/response.headers, making it an instance of httpx.Headers. The same applies to a url field in RequestInfo (tuple of values vs httpx.URL). Should the typehints be updated?
Describe your environment
OS: MacOS 14.5
Python version: 3.12.7
Package version: 0.48.b0
What happened?
When instrumenting
httpx
clients e.g. viaHTTPXClientInstrumentor.instrument_client
, users can passrequest_hook
andresponse_hook
callables which accept namedtuplesRequestInfo
/ResponseInfo
(type definitions). These tuples contain aheader
field typed asOptional[List[Tuple[bytes, bytes]]]
. However, at runtime this field seems to be copied verbatim fromrequest.headers
/response.headers
, making it an instance ofhttpx.Headers
. The same applies to aurl
field inRequestInfo
(tuple of values vshttpx.URL
). Should the typehints be updated?Steps to Reproduce
Expected Result
Actual Result
Additional context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: