Repository navigation
Commit ad15c7a
fix(tracer): declare in_subsegment_async as an async context manager (#8367)
BaseProvider.in_subsegment_async was decorated with @contextmanager and
annotated to return Generator[BaseSegment, None, None], declaring a
synchronous context manager. It is entered with async with by
Tracer._decorate_async_function, by the documented escape hatch for
concurrent async functions, and by the default X-Ray provider.
Remove the decorator and annotate the return type as
AbstractAsyncContextManager[BaseSegment] so correct code type checks
without a cast. No runtime change, the abstract method body is only a
docstring.
Closes #8365
Co-authored-by: Leandro Damascena <lcdama@amazon.pt>1 parent dccd850 commit ad15c7a
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
0 commit comments