Skip to content

refactor(tracer): use standard collections for types #6473

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 3 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 1 deletion aws_lambda_powertools/tracing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@

import abc
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, Generator, Sequence
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
import numbers
import traceback
from collections.abc import Generator, Sequence


class BaseSegment(abc.ABC):
Expand Down
3 changes: 2 additions & 1 deletion aws_lambda_powertools/tracing/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import inspect
import logging
import os
from typing import TYPE_CHECKING, Any, Callable, Sequence, TypeVar, cast, overload
from typing import TYPE_CHECKING, Any, TypeVar, cast, overload

from aws_lambda_powertools.shared import constants
from aws_lambda_powertools.shared.functions import (
Expand All @@ -19,6 +19,7 @@

if TYPE_CHECKING:
import numbers
from collections.abc import Callable, Sequence

from aws_lambda_powertools.tracing.base import BaseProvider, BaseSegment

Expand Down
2 changes: 2 additions & 0 deletions tests/functional/tracer/_aws_xray_sdk/test_tracing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import contextlib

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_tracing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import contextlib
from typing import NamedTuple
from unittest import mock
Expand Down
Loading