This commit is contained in:
Christian Mantha
2026-03-02 19:10:52 -05:00
commit 2ca0b9ef7c
28907 changed files with 5233713 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import contextvars
from dataclasses import dataclass
from typing import Optional
from mlflow.entities import LiveSpan
@dataclass
class SpanWithToken:
"""
A utility container to hold an MLflow span and its corresponding OpenTelemetry token.
The token is a special object that is generated when setting a span as active within
the Open Telemetry span context. This token is required when inactivate the span i.e.
detaching the span from the context.
"""
span: LiveSpan
token: Optional[contextvars.Token] = None