mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-24 17:28:40 +08:00
Add defaults for third-party stubs M-O (#9956)
This commit is contained in:
@@ -5,7 +5,9 @@ import opentracing
|
||||
class SpanContext(opentracing.SpanContext):
|
||||
trace_id: int | None
|
||||
span_id: int | None
|
||||
def __init__(self, trace_id: int | None = ..., span_id: int | None = ..., baggage: dict[str, str] | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self, trace_id: int | None = None, span_id: int | None = None, baggage: dict[str, str] | None = None
|
||||
) -> None: ...
|
||||
@property
|
||||
def baggage(self) -> dict[str, str]: ...
|
||||
def with_baggage_item(self, key: str, value: str) -> Self: ...
|
||||
|
||||
@@ -17,11 +17,11 @@ class MockSpan(Span):
|
||||
def __init__(
|
||||
self,
|
||||
tracer: Tracer,
|
||||
operation_name: str | None = ...,
|
||||
context: SpanContext | None = ...,
|
||||
parent_id: int | None = ...,
|
||||
tags: dict[str, Any] | None = ...,
|
||||
start_time: float | None = ...,
|
||||
operation_name: str | None = None,
|
||||
context: SpanContext | None = None,
|
||||
parent_id: int | None = None,
|
||||
tags: dict[str, Any] | None = None,
|
||||
start_time: float | None = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def tracer(self) -> MockTracer: ...
|
||||
@@ -29,10 +29,10 @@ class MockSpan(Span):
|
||||
def context(self) -> SpanContext: ...
|
||||
def set_operation_name(self, operation_name: str) -> Self: ...
|
||||
def set_tag(self, key: str, value: str | bool | float) -> Self: ...
|
||||
def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ...
|
||||
def log_kv(self, key_values: dict[str, Any], timestamp: float | None = None) -> Self: ...
|
||||
def set_baggage_item(self, key: str, value: str) -> Self: ...
|
||||
|
||||
class LogData:
|
||||
key_values: dict[str, Any]
|
||||
timestamp: float | None
|
||||
def __init__(self, key_values: dict[str, Any], timestamp: float | None = ...) -> None: ...
|
||||
def __init__(self, key_values: dict[str, Any], timestamp: float | None = None) -> None: ...
|
||||
|
||||
@@ -8,7 +8,7 @@ from .propagator import Propagator
|
||||
from .span import MockSpan
|
||||
|
||||
class MockTracer(Tracer):
|
||||
def __init__(self, scope_manager: ScopeManager | None = ...) -> None: ...
|
||||
def __init__(self, scope_manager: ScopeManager | None = None) -> None: ...
|
||||
@property
|
||||
def active_span(self) -> MockSpan | None: ...
|
||||
def register_propagator(self, format: str, propagator: Propagator) -> None: ...
|
||||
@@ -16,11 +16,11 @@ class MockTracer(Tracer):
|
||||
def reset(self) -> None: ...
|
||||
def start_span( # type: ignore[override]
|
||||
self,
|
||||
operation_name: str | None = ...,
|
||||
child_of: Span | SpanContext | None = ...,
|
||||
references: list[Reference] | None = ...,
|
||||
tags: dict[Any, Any] | None = ...,
|
||||
start_time: float | None = ...,
|
||||
ignore_active_span: bool = ...,
|
||||
operation_name: str | None = None,
|
||||
child_of: Span | SpanContext | None = None,
|
||||
references: list[Reference] | None = None,
|
||||
tags: dict[Any, Any] | None = None,
|
||||
start_time: float | None = None,
|
||||
ignore_active_span: bool = False,
|
||||
) -> MockSpan: ...
|
||||
def extract(self, format: str, carrier: dict[Any, Any]) -> SpanContext: ...
|
||||
|
||||
@@ -17,14 +17,14 @@ class Span:
|
||||
@property
|
||||
def tracer(self) -> Tracer: ...
|
||||
def set_operation_name(self, operation_name: str) -> Self: ...
|
||||
def finish(self, finish_time: float | None = ...) -> None: ...
|
||||
def finish(self, finish_time: float | None = None) -> None: ...
|
||||
def set_tag(self, key: str, value: str | bool | float) -> Self: ...
|
||||
def log_kv(self, key_values: dict[str, Any], timestamp: float | None = ...) -> Self: ...
|
||||
def log_kv(self, key_values: dict[str, Any], timestamp: float | None = None) -> Self: ...
|
||||
def set_baggage_item(self, key: str, value: str) -> Self: ...
|
||||
def get_baggage_item(self, key: str) -> str | None: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
def log_event(self, event: Any, payload: Incomplete | None = ...) -> Self: ...
|
||||
def log_event(self, event: Any, payload: Incomplete | None = None) -> Self: ...
|
||||
def log(self, **kwargs: Any) -> Self: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from .scope_manager import ScopeManager
|
||||
from .span import Span, SpanContext
|
||||
|
||||
class Tracer:
|
||||
def __init__(self, scope_manager: ScopeManager | None = ...) -> None: ...
|
||||
def __init__(self, scope_manager: ScopeManager | None = None) -> None: ...
|
||||
@property
|
||||
def scope_manager(self) -> ScopeManager: ...
|
||||
@property
|
||||
@@ -13,21 +13,21 @@ class Tracer:
|
||||
def start_active_span(
|
||||
self,
|
||||
operation_name: str,
|
||||
child_of: Span | SpanContext | None = ...,
|
||||
references: list[Reference] | None = ...,
|
||||
tags: dict[Any, Any] | None = ...,
|
||||
start_time: float | None = ...,
|
||||
ignore_active_span: bool = ...,
|
||||
finish_on_close: bool = ...,
|
||||
child_of: Span | SpanContext | None = None,
|
||||
references: list[Reference] | None = None,
|
||||
tags: dict[Any, Any] | None = None,
|
||||
start_time: float | None = None,
|
||||
ignore_active_span: bool = False,
|
||||
finish_on_close: bool = True,
|
||||
) -> Scope: ...
|
||||
def start_span(
|
||||
self,
|
||||
operation_name: str | None = ...,
|
||||
child_of: Span | SpanContext | None = ...,
|
||||
references: list[Reference] | None = ...,
|
||||
tags: dict[Any, Any] | None = ...,
|
||||
start_time: float | None = ...,
|
||||
ignore_active_span: bool = ...,
|
||||
operation_name: str | None = None,
|
||||
child_of: Span | SpanContext | None = None,
|
||||
references: list[Reference] | None = None,
|
||||
tags: dict[Any, Any] | None = None,
|
||||
start_time: float | None = None,
|
||||
ignore_active_span: bool = False,
|
||||
) -> Span: ...
|
||||
def inject(self, span_context: SpanContext, format: str, carrier: dict[Any, Any]) -> None: ...
|
||||
def extract(self, format: str, carrier: dict[Any, Any]) -> SpanContext: ...
|
||||
@@ -40,8 +40,8 @@ class Reference(NamedTuple):
|
||||
type: str
|
||||
referenced_context: SpanContext | None
|
||||
|
||||
def child_of(referenced_context: SpanContext | None = ...) -> Reference: ...
|
||||
def follows_from(referenced_context: SpanContext | None = ...) -> Reference: ...
|
||||
def child_of(referenced_context: SpanContext | None = None) -> Reference: ...
|
||||
def follows_from(referenced_context: SpanContext | None = None) -> Reference: ...
|
||||
def start_child_span(
|
||||
parent_span: Span, operation_name: str, tags: dict[Any, Any] | None = ..., start_time: float | None = ...
|
||||
parent_span: Span, operation_name: str, tags: dict[Any, Any] | None = None, start_time: float | None = None
|
||||
) -> Span: ...
|
||||
|
||||
Reference in New Issue
Block a user