Skip to content

Commit d93be1c

Browse files
author
Michael Brewer
authored
docs(tracer): Fix Tracer typing hinting for Pycharm (#345)
* docs(tracer): Fix typing for Pycharm * chore: Remove BaseProvider type hint * chore: on second thoughts..
1 parent 4c55108 commit d93be1c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

aws_lambda_powertools/tracing/tracer.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ class Tracer:
5555
`Env POWERTOOLS_TRACE_DISABLED="true"`
5656
patch_modules: Tuple[str]
5757
Tuple of modules supported by tracing provider to patch, by default all modules are patched
58+
provider: BaseProvider
59+
Tracing provider, by default it is aws_xray_sdk.core.xray_recorder
60+
61+
Returns
62+
-------
63+
Tracer
64+
Tracer instance with imported modules patched
5865
5966
Example
6067
-------
@@ -123,17 +130,12 @@ def handler(event: dict, context: Any) -> Dict:
123130
tracer = Tracer()
124131
...
125132
126-
Returns
127-
-------
128-
Tracer
129-
Tracer instance with imported modules patched
130-
131133
Limitations
132134
-----------
133135
* Async handler not supported
134136
"""
135137

136-
_default_config = {
138+
_default_config: Dict[str, Any] = {
137139
"service": "service_undefined",
138140
"disabled": False,
139141
"auto_patch": True,
@@ -153,7 +155,7 @@ def __init__(
153155
self.__build_config(
154156
service=service, disabled=disabled, auto_patch=auto_patch, patch_modules=patch_modules, provider=provider
155157
)
156-
self.provider = self._config["provider"]
158+
self.provider: BaseProvider = self._config["provider"]
157159
self.disabled = self._config["disabled"]
158160
self.service = self._config["service"]
159161
self.auto_patch = self._config["auto_patch"]

0 commit comments

Comments
 (0)