1
0

Maybe fix positional argument mismatch for DummyLink

Hopefully fix:
```
  File "/home/runner/work/synapse/synapse/synapse/storage/controllers/persist_events.py", line 246, in add_to_queue
    links=[Link(end_item.tracing_span_context)],
builtins.TypeError: __init__() takes 1 positional argument but 2 were given
```
This commit is contained in:
Eric Eastwood
2022-09-14 01:59:37 -05:00
parent b77d49f441
commit a027c6e9fe

View File

@@ -216,7 +216,7 @@ class _DummyLookup(object):
class DummyLink(ABC):
"""Dummy placeholder for `opentelemetry.trace.Link`"""
def __init__(self) -> None:
def __init__(self, *args: Any) -> None:
self.not_implemented_message = (
"opentelemetry isn't installed so this is just a dummy link placeholder"
)
@@ -547,7 +547,7 @@ def start_active_span(
name: str,
*,
context: Optional["opentelemetry.context.context.Context"] = None,
kind: Optional["opentelemetry.trace.SpanKind"] = SpanKind.INTERNAL,
kind: "opentelemetry.trace.SpanKind" = SpanKind.INTERNAL,
attributes: "opentelemetry.util.types.Attributes" = None,
links: Optional[Sequence["opentelemetry.trace.Link"]] = None,
start_time: Optional[int] = None,
@@ -560,11 +560,6 @@ def start_active_span(
if opentelemetry is None:
return contextlib.nullcontext() # type: ignore[unreachable]
# TODO: Why is this necessary to satisfy this error? It has a default?
# ` error: Argument "kind" to "start_span" of "Tracer" has incompatible type "Optional[SpanKind]"; expected "SpanKind" [arg-type]`
if kind is None:
kind = SpanKind.INTERNAL
span = start_span(
name=name,
context=context,