Skip to content

httpx: update type hints to RequestInfo/ResponseInfo #3105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- `opentelemetry-instrumentation-httpx` Update `RequestInfo`/`ResponseInfo` type hints
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `opentelemetry-instrumentation-httpx` Update `RequestInfo`/`ResponseInfo` type hints
### Fixed
- `opentelemetry-instrumentation-httpx` Fix `RequestInfo`/`ResponseInfo` type hints

([#3105](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3105))

## Version 1.29.0/0.50b0 (2024-12-11)

### Added
Expand Down
1 change: 1 addition & 0 deletions docs/nitpick-exceptions.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ py-class=
httpx.SyncByteStream
httpx.AsyncByteStream
httpx.Response
httpx.URL
aiohttp.web_request.Request
yarl.URL
cimpl.Producer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ async def async_response_hook(span, request, response):
---
"""

from __future__ import annotations

import logging
import typing
from asyncio import iscoroutinefunction
Expand Down Expand Up @@ -249,8 +251,8 @@ async def async_response_hook(span, request, response):

class RequestInfo(typing.NamedTuple):
method: bytes
url: URL
headers: typing.Optional[Headers]
url: httpx.URL
headers: httpx.Headers | None
stream: typing.Optional[
typing.Union[httpx.SyncByteStream, httpx.AsyncByteStream]
]
Expand All @@ -259,7 +261,7 @@ class RequestInfo(typing.NamedTuple):

class ResponseInfo(typing.NamedTuple):
status_code: int
headers: typing.Optional[Headers]
headers: httpx.Headers | None
stream: typing.Iterable[bytes]
extensions: typing.Optional[dict]

Expand Down
Loading