Skip to content

Commit e9b4f54

Browse files
authored
fix(typing): swap NoReturn with None for methods with no return value (#2004)
1 parent 6ff09e4 commit e9b4f54

File tree

1 file changed

+7
-7
lines changed
  • aws_lambda_powertools/tracing

1 file changed

+7
-7
lines changed

Diff for: aws_lambda_powertools/tracing/base.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numbers
33
import traceback
44
from contextlib import contextmanager
5-
from typing import Any, Generator, List, NoReturn, Optional, Sequence, Union
5+
from typing import Any, Generator, List, Optional, Sequence, Union
66

77

88
class BaseSegment(abc.ABC):
@@ -28,7 +28,7 @@ def remove_subsegment(self, subsegment: Any):
2828
"""Remove input subsegment from child subsegments."""
2929

3030
@abc.abstractmethod
31-
def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> NoReturn:
31+
def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> None:
3232
"""Annotate segment or subsegment with a key-value pair.
3333
3434
Note: Annotations will be indexed for later search query.
@@ -42,7 +42,7 @@ def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> N
4242
"""
4343

4444
@abc.abstractmethod
45-
def put_metadata(self, key: str, value: Any, namespace: str = "default") -> NoReturn:
45+
def put_metadata(self, key: str, value: Any, namespace: str = "default") -> None:
4646
"""Add metadata to segment or subsegment. Metadata is not indexed
4747
but can be later retrieved by BatchGetTraces API.
4848
@@ -101,7 +101,7 @@ def in_subsegment_async(self, name=None, **kwargs) -> Generator[BaseSegment, Non
101101
"""
102102

103103
@abc.abstractmethod
104-
def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> NoReturn:
104+
def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> None:
105105
"""Annotate current active trace entity with a key-value pair.
106106
107107
Note: Annotations will be indexed for later search query.
@@ -115,7 +115,7 @@ def put_annotation(self, key: str, value: Union[str, numbers.Number, bool]) -> N
115115
"""
116116

117117
@abc.abstractmethod
118-
def put_metadata(self, key: str, value: Any, namespace: str = "default") -> NoReturn:
118+
def put_metadata(self, key: str, value: Any, namespace: str = "default") -> None:
119119
"""Add metadata to the current active trace entity.
120120
121121
Note: Metadata is not indexed but can be later retrieved by BatchGetTraces API.
@@ -131,7 +131,7 @@ def put_metadata(self, key: str, value: Any, namespace: str = "default") -> NoRe
131131
"""
132132

133133
@abc.abstractmethod
134-
def patch(self, modules: Sequence[str]) -> NoReturn:
134+
def patch(self, modules: Sequence[str]) -> None:
135135
"""Instrument a set of supported libraries
136136
137137
Parameters
@@ -141,5 +141,5 @@ def patch(self, modules: Sequence[str]) -> NoReturn:
141141
"""
142142

143143
@abc.abstractmethod
144-
def patch_all(self) -> NoReturn:
144+
def patch_all(self) -> None:
145145
"""Instrument all supported libraries"""

0 commit comments

Comments
 (0)