Skip to content

Commit aef0232

Browse files
[opentracing] Refine Span.log_event, MockSpan, and ScopeManager annotations
1 parent 98ab147 commit aef0232

8 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎pyrightconfig.stricter.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"stubs/networkx",
6767
"stubs/oauthlib",
6868
"stubs/openpyxl",
69-
"stubs/opentracing/opentracing/span.pyi",
7069
"stubs/paramiko/paramiko/_winapi.pyi",
7170
"stubs/parsimonious/parsimonious/nodes.pyi",
7271
"stubs/peewee",

‎stubs/opentracing/opentracing/mocktracer/span.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from .tracer import MockTracer
88

99
class MockSpan(Span):
1010
operation_name: str | None
11-
start_time: Any
11+
start_time: float | None
1212
parent_id: int | None
1313
tags: dict[str, Any]
1414
finish_time: float
@@ -34,5 +34,5 @@ class MockSpan(Span):
3434

3535
class LogData:
3636
key_values: dict[str, Any]
37-
timestamp: float | None
37+
timestamp: float
3838
def __init__(self, key_values: dict[str, Any], timestamp: float | None = None) -> None: ...

‎stubs/opentracing/opentracing/scope_managers/__init__.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ class ThreadLocalScopeManager(ScopeManager):
66
def __init__(self) -> None: ...
77
def activate(self, span: Span, finish_on_close: bool) -> Scope: ...
88
@property
9-
def active(self) -> Scope: ...
9+
def active(self) -> Scope | None: ...

‎stubs/opentracing/opentracing/scope_managers/asyncio.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ from ..span import Span
55
class AsyncioScopeManager(ThreadLocalScopeManager):
66
def activate(self, span: Span, finish_on_close: bool) -> Scope: ...
77
@property
8-
def active(self) -> Scope: ...
8+
def active(self) -> Scope | None: ...

‎stubs/opentracing/opentracing/scope_managers/contextvars.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ from ..span import Span
55
class ContextVarsScopeManager(ScopeManager):
66
def activate(self, span: Span, finish_on_close: bool) -> Scope: ...
77
@property
8-
def active(self) -> Scope: ...
8+
def active(self) -> Scope | None: ...
99

1010
def no_parent_scope() -> None: ...

‎stubs/opentracing/opentracing/scope_managers/gevent.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ from ..span import Span
55
class GeventScopeManager(ScopeManager):
66
def activate(self, span: Span, finish_on_close: bool) -> Scope: ...
77
@property
8-
def active(self) -> Scope: ...
8+
def active(self) -> Scope | None: ...

‎stubs/opentracing/opentracing/scope_managers/tornado.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from ..span import Span
77
class TornadoScopeManager(ThreadLocalScopeManager):
88
def activate(self, span: Span, finish_on_close: bool) -> Scope: ...
99
@property
10-
def active(self) -> Scope: ...
10+
def active(self) -> Scope | None: ...
1111

1212
class ThreadSafeStackContext:
1313
contexts: Any

‎stubs/opentracing/opentracing/span.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ class Span:
2525
def __exit__(
2626
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
2727
) -> None: ...
28-
def log_event(self, event: Any, payload=None) -> Self: ...
28+
def log_event(self, event: Any, payload: Any = None) -> Self: ...
2929
def log(self, **kwargs: Any) -> Self: ...

0 commit comments

Comments
 (0)