Skip to content

Commit 081fd43

Browse files
committed
Use new style type annotations
1 parent 2cc8707 commit 081fd43

File tree

1 file changed

+8
-6
lines changed
  • instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions

1 file changed

+8
-6
lines changed

instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import logging
16-
from typing import Any, Dict, Optional, Tuple
18+
from typing import Any, Optional, Tuple
1719

1820
from opentelemetry._events import EventLogger
1921
from opentelemetry.metrics import Instrument, Meter
@@ -24,11 +26,11 @@
2426
_logger = logging.getLogger(__name__)
2527

2628
_BotoClientT = "botocore.client.BaseClient"
27-
_BotoResultT = Dict[str, Any]
29+
_BotoResultT = dict[str, Any]
2830
_BotoClientErrorT = "botocore.exceptions.ClientError"
2931

30-
_OperationParamsT = Dict[str, Any]
31-
_AttributeMapT = Dict[str, AttributeValue]
32+
_OperationParamsT = dict[str, Any]
33+
_AttributeMapT = dict[str, AttributeValue]
3234

3335

3436
class _AwsSdkCallContext:
@@ -48,7 +50,7 @@ class _AwsSdkCallContext:
4850
span_kind: the kind used to create the span.
4951
"""
5052

51-
def __init__(self, client: _BotoClientT, args: Tuple[str, Dict[str, Any]]):
53+
def __init__(self, client: _BotoClientT, args: Tuple[str, dict[str, Any]]):
5254
operation = args[0]
5355
try:
5456
params = args[1]
@@ -95,7 +97,7 @@ class _BotocoreInstrumentorContext:
9597
def __init__(
9698
self,
9799
event_logger: EventLogger,
98-
metrics: Optional[Dict[str, Instrument]] = None,
100+
metrics: dict[str, Instrument] | None = None,
99101
):
100102
self.event_logger = event_logger
101103
self.metrics = metrics or {}

0 commit comments

Comments
 (0)