Skip to content

Commit 22b3852

Browse files
refactor(tracer): use standard collections for types (#6473)
Using generics types Co-authored-by: Ana Falcão <[email protected]>
1 parent bde274d commit 22b3852

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

aws_lambda_powertools/tracing/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
import abc
1010
from contextlib import contextmanager
11-
from typing import TYPE_CHECKING, Any, Generator, Sequence
11+
from typing import TYPE_CHECKING, Any
1212

1313
if TYPE_CHECKING:
1414
import numbers
1515
import traceback
16+
from collections.abc import Generator, Sequence
1617

1718

1819
class BaseSegment(abc.ABC):

aws_lambda_powertools/tracing/tracer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import inspect
77
import logging
88
import os
9-
from typing import TYPE_CHECKING, Any, Callable, Sequence, TypeVar, cast, overload
9+
from typing import TYPE_CHECKING, Any, TypeVar, cast, overload
1010

1111
from aws_lambda_powertools.shared import constants
1212
from aws_lambda_powertools.shared.functions import (
@@ -19,6 +19,7 @@
1919

2020
if TYPE_CHECKING:
2121
import numbers
22+
from collections.abc import Callable, Sequence
2223

2324
from aws_lambda_powertools.tracing.base import BaseProvider, BaseSegment
2425

tests/functional/tracer/_aws_xray_sdk/test_tracing.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import contextlib
24

35
import pytest

tests/unit/test_tracing.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import contextlib
24
from typing import NamedTuple
35
from unittest import mock

0 commit comments

Comments
 (0)