repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
mlflow | mlflow/tracing/client.py | .py | import json
import logging
import time
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from contextlib import nullcontext
from typing import TYPE_CHECKING, Sequence
import mlflow
if TYPE_CHECKING:
from mlflow.genai.label_schemas.label_schemas import (
InputCategorical... | 1,104 | 44,937 |
mlflow | mlflow/tracing/context.py | .py | from __future__ import annotations
import contextlib
from contextvars import ContextVar
from dataclasses import dataclass, field
from typing import Generator
from mlflow.tracing.constant import TraceMetadataKey
@dataclass(frozen=True)
class _UserTraceContext:
"""
Metadata and tags declared via ``mlflow.trac... | 124 | 4,633 |
mlflow | mlflow/tracing/enablement.py | .py | """
Trace enablement functionality for MLflow to enable tracing to Databricks Storage.
"""
import logging
import mlflow
from mlflow.entities.trace_location import UCSchemaLocation
from mlflow.exceptions import MlflowException
from mlflow.utils.uri import is_databricks_uri
from mlflow.version import IS_TRACING_SDK_ONL... | 161 | 5,949 |
mlflow | mlflow/tracing/trace_archival_service.py | .py | from __future__ import annotations
import logging
import random
import threading
import time
from contextlib import nullcontext
from dataclasses import dataclass
from mlflow.entities.workspace import TraceArchivalConfig
from mlflow.environment_variables import (
MLFLOW_ENABLE_WORKSPACES,
)
from mlflow.exceptions ... | 213 | 8,102 |
mlflow | mlflow/tracing/locations.py | .py | from mlflow.entities.trace_location import UnityCatalog
__all__ = ["UnityCatalog"]
| 4 | 84 |
mlflow | mlflow/tracing/constant.py | .py | from enum import Enum
# NB: These keys are placeholders and subject to change
class TraceMetadataKey:
INPUTS = "mlflow.traceInputs"
OUTPUTS = "mlflow.traceOutputs"
SOURCE_RUN = "mlflow.sourceRun"
MODEL_ID = "mlflow.modelId"
# Trace size statistics including total size, number of spans, and max spa... | 397 | 14,432 |
mlflow | mlflow/tracing/fluent.py | .py | from __future__ import annotations
import contextlib
import functools
import importlib
import inspect
import json
import logging
import os
import warnings
from concurrent.futures import ThreadPoolExecutor
from contextvars import ContextVar
from typing import TYPE_CHECKING, Any, Callable, Generator, Literal, ParamSpec,... | 1,975 | 77,248 |
mlflow | mlflow/tracing/config.py | .py | from dataclasses import dataclass, field, replace
from typing import TYPE_CHECKING, Any, Callable
from mlflow.tracing.utils.processor import validate_span_processors
if TYPE_CHECKING:
from mlflow.entities.span import LiveSpan
@dataclass
class TracingConfig:
"""Configuration for MLflow tracing behavior."""
... | 124 | 4,413 |
mlflow | mlflow/tracing/attachments.py | .py | import mimetypes
import uuid
from pathlib import Path
from urllib.parse import parse_qs, urlencode, urlparse
class Attachment:
"""
Represents a binary attachment (image, audio, PDF, etc.) that can be logged
as part of a trace span's inputs or outputs.
When an Attachment is set as a span input/output ... | 74 | 2,437 |
mlflow | mlflow/tracing/export/inference_table.py | .py | import logging
from typing import Any, Sequence
from cachetools import TTLCache
from opentelemetry.sdk.trace import ReadableSpan
from opentelemetry.sdk.trace.export import SpanExporter
from mlflow.entities.model_registry import PromptVersion
from mlflow.entities.trace import Trace
from mlflow.environment_variables im... | 163 | 6,957 |
mlflow | mlflow/tracing/export/utils.py | .py | """
Utility functions for prompt linking in trace exporters.
"""
import logging
import threading
import uuid
from typing import Sequence
from mlflow.entities.model_registry import PromptVersion
from mlflow.tracing.client import TracingClient
_logger = logging.getLogger(__name__)
def try_link_prompts_to_trace(
... | 71 | 2,201 |
mlflow | mlflow/tracing/export/span_batcher.py | .py | import atexit
import logging
import threading
from collections import defaultdict
from queue import Queue
from typing import Callable
from mlflow.entities.span import Span
from mlflow.environment_variables import (
MLFLOW_ASYNC_TRACE_LOGGING_MAX_INTERVAL_MILLIS,
MLFLOW_ASYNC_TRACE_LOGGING_MAX_SPAN_BATCH_SIZE,
... | 123 | 4,682 |
mlflow | mlflow/tracing/export/async_export_queue.py | .py | import atexit
import logging
import threading
import time
from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait
from dataclasses import dataclass
from queue import Empty, Queue
from queue import Full as queue_Full
from typing import Any, Callable, Sequence
from mlflow.environment_variables import (
... | 188 | 6,851 |
mlflow | mlflow/tracing/export/uc_table.py | .py | import logging
from typing import Sequence
from opentelemetry.sdk.trace import ReadableSpan
from mlflow.entities.span import Span
from mlflow.entities.trace_info import TraceInfo
from mlflow.environment_variables import MLFLOW_ENABLE_ASYNC_TRACE_LOGGING
from mlflow.tracing.export.mlflow_v3 import MlflowV3SpanExporter... | 76 | 2,863 |
mlflow | mlflow/tracing/export/mlflow_v3.py | .py | import logging
import os
import threading
from collections import defaultdict
from contextlib import nullcontext
from typing import Sequence
from opentelemetry.sdk.trace import ReadableSpan
from opentelemetry.sdk.trace.export import SpanExporter
from mlflow.entities.model_registry import PromptVersion
from mlflow.ent... | 425 | 19,908 |
mlflow | mlflow/tracing/export/genai_semconv/converter.py | .py | """
Abstract base class for format-specific message converters.
Each LLM provider stores inputs/outputs in its own format (e.g. OpenAI, Anthropic).
Converters translate these provider-specific formats into the GenAI Semantic Convention
attributes: gen_ai.input.messages, gen_ai.output.messages, request params, and resp... | 84 | 3,536 |
mlflow | mlflow/tracing/export/genai_semconv/translator.py | .py | """
Core translator for converting MLflow spans to OpenTelemetry GenAI Semantic Convention format.
Phase 1: Universal attributes (model, provider, tokens, span type) normalized across all
autologging integrations.
Phase 2: Format-specific message content (gen_ai.input.messages, gen_ai.output.messages),
request params,... | 223 | 8,446 |
mlflow | mlflow/tracing/display/__init__.py | .py | from mlflow.tracing.display.display_handler import (
IPythonTraceDisplayHandler,
get_notebook_iframe_html,
is_using_tracking_server,
)
__all__ = [
"IPythonTraceDisplayHandler",
"get_display_handler",
"is_using_tracking_server",
"get_notebook_iframe_html",
]
def get_display_handler() -> IP... | 41 | 1,265 |
mlflow | mlflow/tracing/display/display_handler.py | .py | import html
import json
import logging
from typing import TYPE_CHECKING
from urllib.parse import urlencode, urljoin
import mlflow
from mlflow.environment_variables import (
MLFLOW_MAX_TRACES_TO_DISPLAY_IN_NOTEBOOK,
MLFLOW_NOTEBOOK_TRACE_RENDERER_BASE_URL,
)
from mlflow.tracing.constant import TRACE_RENDERER_AS... | 213 | 7,242 |
mlflow | mlflow/tracing/distributed/__init__.py | .py | import logging
from contextlib import contextmanager
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
import mlflow
from mlflow.entities.span import LiveSpan
from mlflow.telemetry.events import TracingContextPropagation
from mlflow.telemetry.track import record_usage_event
from m... | 191 | 7,442 |
mlflow | mlflow/tracing/otel/otel_archival.py | .py | """
Helpers for serializing archived trace spans as OTLP ``TracesData`` protobuf.
"""
from __future__ import annotations
from typing import Any
from google.protobuf.message import DecodeError
from opentelemetry.proto.trace.v1.trace_pb2 import TracesData
from mlflow.entities.span import Span
from mlflow.exceptions i... | 133 | 5,008 |
mlflow | mlflow/tracing/otel/translation/langfuse.py | .py | """
Translation utilities for Langfuse observation attributes.
Maps ``langfuse.observation.*`` attributes to MLflow span semantics so that
spans forwarded from Langfuse via the generic OTEL processor are stored with
correct span types, inputs, and outputs.
"""
from mlflow.entities.span import SpanType
from mlflow.tra... | 30 | 965 |
mlflow | mlflow/tracing/otel/translation/gemini_cli.py | .py | """
Translator for Gemini CLI OTEL spans.
Gemini CLI (google-gemini/gemini-cli) emits OTLP traces using `gen_ai.operation.name`
for span kind (same key as the GenAI semantic conventions), but with its own operation
names that don't match the standard GenAI values. This translator maps those
Gemini-specific names to M... | 157 | 6,446 |
mlflow | mlflow/tracing/otel/translation/genai_semconv.py | .py | """
Translation utilities for GenAI (Generic AI) semantic conventions.
Reference: https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/
"""
import json
from typing import Any
from mlflow.entities.span import SpanType
from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class GenA... | 133 | 5,079 |
mlflow | mlflow/tracing/otel/translation/livekit.py | .py | """
Translation utilities for LiveKit Agents semantic conventions.
LiveKit Agents (Python SDK) provides real-time AI voice agents with built-in
OpenTelemetry support. This translator maps LiveKit's span attributes to MLflow's
semantic conventions for optimal visualization.
Reference:
- https://docs.livekit.io/agents/... | 117 | 3,770 |
mlflow | mlflow/tracing/otel/translation/__init__.py | .py | """
Utilities for translating OTEL span attributes to MLflow span format.
This module provides functions to translate span attributes from various
OTEL semantic conventions (OpenInference, Traceloop, GenAI) to MLflow span types.
It uses modular translator classes for each OTEL schema for better organization
and perfor... | 487 | 17,665 |
mlflow | mlflow/tracing/otel/translation/laminar.py | .py | from typing import Any
from mlflow.entities.span import SpanType
from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class LaminarTranslator(OtelSchemaTranslator):
SPAN_KIND_ATTRIBUTE_KEY = "lmnr.span.type"
SPAN_KIND_TO_MLFLOW_TYPE = {
"LLM": SpanType.LLM,
"TOOL": SpanType.... | 39 | 1,224 |
mlflow | mlflow/tracing/otel/translation/traceloop.py | .py | """
Translation utilities for Traceloop/OpenLLMetry semantic conventions.
Reference: https://github.com/traceloop/openllmetry/
"""
import re
from typing import Any
from mlflow.entities.span import SpanType
from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class TraceloopTranslator(OtelSchemaTra... | 83 | 3,733 |
mlflow | mlflow/tracing/otel/translation/open_inference.py | .py | """
Translation utilities for OpenInference semantic conventions.
Reference: https://github.com/Arize-ai/openinference/blob/main/python/openinference-semantic-conventions/
"""
from mlflow.entities.span import SpanType
from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class OpenInferenceTranslato... | 55 | 2,644 |
mlflow | mlflow/tracing/otel/translation/voltagent.py | .py | import json
from typing import Any
from mlflow.entities.span import SpanType
from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class VoltAgentTranslator(OtelSchemaTranslator):
"""
Translator for VoltAgent semantic conventions.
VoltAgent provides clean chat-formatted messages in `agen... | 122 | 4,341 |
mlflow | mlflow/tracing/otel/translation/spring_ai.py | .py | """
Translation utilities for Spring AI semantic conventions.
Spring AI uses OpenTelemetry GenAI semantic conventions but stores
prompt/completion content in events rather than attributes:
- gen_ai.content.prompt event with gen_ai.prompt attribute
- gen_ai.content.completion event with gen_ai.completion attribute
Ref... | 98 | 3,218 |
mlflow | mlflow/tracing/otel/translation/google_adk.py | .py | from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class GoogleADKTranslator(OtelSchemaTranslator):
"""
Translator for Google ADK semantic conventions.
Google ADK mostly uses OpenTelemetry semantic conventions, but with some custom
inputs and outputs attributes.
"""
# Input... | 15 | 667 |
mlflow | mlflow/tracing/otel/translation/vercel_ai.py | .py | import json
from typing import Any
from mlflow.entities.span import SpanType
from mlflow.tracing.constant import SpanAttributeKey
from mlflow.tracing.otel.translation.base import OtelSchemaTranslator
class VercelAITranslator(OtelSchemaTranslator):
"""Translator for Vercel AI SDK spans."""
# https://ai-sdk.d... | 92 | 3,350 |
mlflow | mlflow/tracing/otel/translation/base.py | .py | """
Base class for OTEL semantic convention translators.
This module provides a base class that implements common translation logic.
Subclasses only need to define the attribute keys and mappings as class attributes.
"""
import json
import logging
from typing import Any
_logger = logging.getLogger(__name__)
class ... | 238 | 7,822 |
mlflow | mlflow/tracing/processor/inference_table.py | .py | import json
import logging
from opentelemetry.context import Context
from opentelemetry.sdk.trace import ReadableSpan as OTelReadableSpan
from opentelemetry.sdk.trace import Span as OTelSpan
from opentelemetry.sdk.trace.export import SimpleSpanProcessor, SpanExporter
from mlflow.entities.span import create_mlflow_spa... | 190 | 8,292 |
mlflow | mlflow/tracing/processor/otel.py | .py | import logging
from opentelemetry.sdk.trace import ReadableSpan as OTelReadableSpan
from opentelemetry.sdk.trace.export import BatchSpanProcessor, SpanExporter
from mlflow.entities.span import create_mlflow_span
from mlflow.entities.trace_info import TraceInfo, TraceLocation, TraceState
from mlflow.environment_variab... | 106 | 4,649 |
mlflow | mlflow/tracing/processor/base_mlflow.py | .py | import json
import logging
import threading
import weakref
from typing import Any
from opentelemetry.context import Context
from opentelemetry.sdk.trace import ReadableSpan as OTelReadableSpan
from opentelemetry.sdk.trace import Span as OTelSpan
from opentelemetry.sdk.trace.export import (
BatchSpanProcessor,
... | 393 | 17,862 |
mlflow | mlflow/tracing/processor/uc_table.py | .py | import logging
from opentelemetry.sdk.trace import ReadableSpan as OTelReadableSpan
from opentelemetry.sdk.trace import Span as OTelSpan
from opentelemetry.sdk.trace.export import SpanExporter
from mlflow.entities.trace_info import TraceInfo
from mlflow.entities.trace_location import TraceLocation, UCSchemaLocation, ... | 105 | 4,486 |
mlflow | mlflow/tracing/processor/mlflow_v3.py | .py | import logging
from opentelemetry.sdk.trace import Span as OTelSpan
from opentelemetry.sdk.trace.export import SpanExporter
from mlflow.entities.trace_info import TraceInfo
from mlflow.entities.trace_location import TraceLocation
from mlflow.entities.trace_state import TraceState
from mlflow.tracing.processor.base_ml... | 54 | 2,042 |
mlflow | mlflow/tracing/processor/otel_metrics_mixin.py | .py | """
Mixin class for OpenTelemetry span processors that provides metrics recording functionality.
This mixin allows different span processor implementations to share common metrics logic
while maintaining their own inheritance hierarchies (BatchSpanProcessor, SimpleSpanProcessor).
"""
import logging
from typing import... | 122 | 4,737 |
mlflow | mlflow/tracing/utils/copy.py | .py | from typing import Any
from mlflow.entities.span import LiveSpan, Span
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_STATE
from mlflow.tracing.trace_manager import InMemoryTraceManager
def copy_trace_to_experiment(trace_dict: dict[str, Any], experiment_id: str | None ... | 63 | 2,583 |
mlflow | mlflow/tracing/utils/default_log_level.py | .py | from __future__ import annotations
from mlflow.entities.span_log_level import SpanLogLevel
# Span types whose default level is INFO. These represent the user-visible
# semantic operations (model calls, tool calls, retrievals, agent turns, etc.)
# that should remain visible at the default UI threshold. Everything else... | 34 | 1,257 |
mlflow | mlflow/tracing/utils/once.py | .py | # Customized from https://github.com/open-telemetry/opentelemetry-python/blob/754fc36a408dd45e86d4a0f820f84e692f14b4c1/opentelemetry-api/src/opentelemetry/util/_once.py
from threading import Lock
from typing import Callable
class Once:
"""Execute a function exactly once and block all callers until the function re... | 26 | 800 |
mlflow | mlflow/tracing/utils/timeout.py | .py | import atexit
import logging
import threading
import time
from collections import OrderedDict
from cachetools import Cache, TTLCache
from mlflow.entities.span_event import SpanEvent
from mlflow.entities.span_status import SpanStatusCode
from mlflow.environment_variables import (
MLFLOW_TRACE_BUFFER_MAX_SIZE,
... | 251 | 8,779 |
mlflow | mlflow/tracing/utils/token.py | .py | from dataclasses import dataclass
from typing import TYPE_CHECKING
from mlflow.entities import LiveSpan
if TYPE_CHECKING:
from mlflow.tracing.provider import SpanContextToken
@dataclass
class SpanWithToken:
"""
A utility container to hold an MLflow span and its corresponding OpenTelemetry token.
Th... | 23 | 751 |
mlflow | mlflow/tracing/utils/environment.py | .py | import logging
import os
from functools import lru_cache
from mlflow.tracking.context.git_context import GitRunContext
from mlflow.tracking.context.registry import resolve_tags
from mlflow.utils.databricks_utils import is_in_databricks_notebook
from mlflow.utils.git_utils import get_git_branch, get_git_commit, get_git... | 56 | 1,974 |
mlflow | mlflow/tracing/utils/warning.py | .py | import functools
import importlib
import logging
import warnings
_logger = logging.getLogger(__name__)
class LogDemotionFilter(logging.Filter):
def __init__(self, module: str, message: str):
super().__init__()
self.module = module
self.message = message
def filter(self, record: loggi... | 76 | 2,655 |
mlflow | mlflow/tracing/utils/__init__.py | .py | # TODO: Split this file into multiple files and move under utils directory.
from __future__ import annotations
import inspect
import json
import logging
import uuid
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, fields, is_dataclass
from functools import lr... | 953 | 35,005 |
mlflow | mlflow/tracing/utils/exception.py | .py | import functools
from mlflow.exceptions import MlflowTracingException
def raise_as_trace_exception(f):
"""
A decorator to make sure that the decorated function only raises MlflowTracingException.
Any exceptions are caught and translated to MlflowTracingException before exiting the function.
This is ... | 22 | 618 |
mlflow | mlflow/tracing/utils/artifact_utils.py | .py | from mlflow.entities.trace_info import TraceInfo
from mlflow.exceptions import MlflowTraceDataCorrupted
from mlflow.tracing.constant import TraceTagKey
from mlflow.utils.mlflow_tags import MLFLOW_ARTIFACT_LOCATION
TRACE_DATA_FILE_NAME = "traces.json"
def _get_trace_request_id(trace_info: TraceInfo) -> str | None:
... | 45 | 1,581 |
mlflow | mlflow/tracing/utils/search.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal, NamedTuple
from mlflow.exceptions import MlflowException
SPANS_COLUMN_NAME = "spans"
if TYPE_CHECKING:
import pandas
import mlflow.entities
from mlflow.entities import Trace
def traces_to_df(
traces: list[Trace], e... | 199 | 6,157 |
mlflow | mlflow/tracing/utils/processor.py | .py | import logging
from mlflow.exceptions import MlflowException
_logger = logging.getLogger(__name__)
def apply_span_processors(span):
"""Apply configured span processors sequentially to the span."""
from mlflow.tracing.config import get_config
config = get_config()
if not config.span_processors:
... | 55 | 1,809 |
mlflow | mlflow/tracing/utils/prompt.py | .py | import json
from mlflow.entities.model_registry import PromptVersion
from mlflow.exceptions import MlflowException
from mlflow.tracing.constant import TraceTagKey
# TODO: Remove tag based linking once we migrate to LinkPromptsToTraces endpoint
def update_linked_prompts_tag(current_tag_value: str | None, prompt_versi... | 48 | 1,750 |
mlflow | mlflow/tracing/utils/truncation.py | .py | import json
from functools import lru_cache
from typing import Any
from mlflow.entities.trace_data import TraceData
from mlflow.entities.trace_info import TraceInfo
from mlflow.tracing.constant import (
TRACE_REQUEST_RESPONSE_PREVIEW_MAX_LENGTH_DBX,
TRACE_REQUEST_RESPONSE_PREVIEW_MAX_LENGTH_OSS,
)
from mlflow.... | 130 | 4,524 |
mlflow | mlflow/tracing/utils/otlp.py | .py | import base64
import gzip
import os
import zlib
from typing import Any
from opentelemetry.proto.common.v1.common_pb2 import AnyValue, ArrayValue, KeyValueList
from opentelemetry.proto.resource.v1.resource_pb2 import Resource as OTelProtoResource
from opentelemetry.sdk.resources import Resource as OTelResource
from ope... | 286 | 10,344 |
mlflow | mlflow/entities/run_status.py | .py | from mlflow.protos.service_pb2 import RunStatus as ProtoRunStatus
class RunStatus:
"""Enum for status of an :py:class:`mlflow.entities.Run`."""
RUNNING = ProtoRunStatus.Value("RUNNING")
SCHEDULED = ProtoRunStatus.Value("SCHEDULED")
FINISHED = ProtoRunStatus.Value("FINISHED")
FAILED = ProtoRunStat... | 42 | 1,540 |
mlflow | mlflow/entities/run_tag.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import RunTag as ProtoRunTag
class RunTag(_MlflowObject):
"""Tag object associated with a run."""
def __init__(self, key, value):
self._key = key
self._value = value
def __eq__(self, other):
i... | 37 | 890 |
mlflow | mlflow/entities/mcp_access_endpoint.py | .py | from __future__ import annotations
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any
from mlflow.entities.mcp_server import MCPRemoteTransportType
from mlflow.exceptions import MlflowException
from mlflow.utils.annotations import experimental
from mlflow.utils.workspace_utils import resol... | 72 | 2,782 |
mlflow | mlflow/entities/scorer.py | .py | import json
from functools import cached_property
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import Scorer as ProtoScorer
class ScorerVersion(_MlflowObject):
"""
A versioned scorer entity that represents a specific version of a scorer within an MLflow
experime... | 207 | 7,409 |
mlflow | mlflow/entities/metric.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
from mlflow.protos.service_pb2 import Metric as ProtoMetric
from mlflow.protos.service_pb2 import MetricWithRunId as ProtoMetricWithRunId
class Metric... | 196 | 5,538 |
mlflow | mlflow/entities/trace.py | .py | from __future__ import annotations
import json
import logging
import re
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Literal
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.span import Span, SpanType
from mlflow.entities.trace_data import TraceData
from mlflow... | 331 | 11,688 |
mlflow | mlflow/entities/span_event.py | .py | import json
import time
import traceback
from dataclasses import dataclass, field
from datetime import datetime
from opentelemetry.util.types import AttributeValue
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.tracing.utils.otlp import _set_otel_proto_anyvalue
@dataclass
class SpanEvent(_Mlfl... | 104 | 3,382 |
mlflow | mlflow/entities/entity_type.py | .py | """
Entity type constants for MLflow's entity_association table.
The entity_association table enables many-to-many relationships between different
MLflow entities. It uses source and destination type/id pairs to create flexible
associations without requiring dedicated junction tables for each relationship type.
"""
c... | 18 | 594 |
mlflow | mlflow/entities/gateway_endpoint.py | .py | from __future__ import annotations
from dataclasses import dataclass, field
from enum import Enum
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import FallbackConfig as ProtoFallbackConfig
from mlflow.protos.service_pb2 import FallbackStrategy as ProtoFallbackStrategy
from ml... | 483 | 17,951 |
mlflow | mlflow/entities/dataset_input.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.dataset import Dataset
from mlflow.entities.input_tag import InputTag
from mlflow.protos.service_pb2 import DatasetInput as ProtoDatasetInput
class DatasetInput(_MlflowObject):
"""DatasetInput object associated with an experiment."""
... | 50 | 1,581 |
mlflow | mlflow/entities/workspace.py | .py | """Workspace entity shared between server and stores."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import Any
from mlflow.protos.service_pb2 import Workspace as ProtoWorkspace
class WorkspaceDeletionMode(str, Enum):
"""Controls what happens to resour... | 109 | 4,265 |
mlflow | mlflow/entities/gateway_secrets.py | .py | from dataclasses import dataclass
from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import GatewaySecretInfo as ProtoGatewaySecretInfo
from mlflow.utils.workspace_utils import resolve_entity_workspace_name
@dataclass(frozen=True)
class GatewaySecretInfo(_M... | 90 | 3,975 |
mlflow | mlflow/entities/trace_location.py | .py | from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.exceptions import MlflowException
from mlflow.protos import service_pb2 as pb
from mlflow.utils.annotations import deprecated, experime... | 397 | 13,937 |
mlflow | mlflow/entities/trace_info.py | .py | import json
from dataclasses import dataclass, field
from typing import Any
from google.protobuf.duration_pb2 import Duration
from google.protobuf.json_format import MessageToDict
from google.protobuf.timestamp_pb2 import Timestamp
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.assessme... | 266 | 10,826 |
mlflow | mlflow/entities/evaluation_dataset.py | .py | from __future__ import annotations
import json
from enum import Enum
from typing import TYPE_CHECKING, Any
from mlflow.data import Dataset
from mlflow.data.evaluation_dataset_source import EvaluationDatasetSource
from mlflow.data.pyfunc_dataset_mixin import PyFuncConvertibleDatasetMixin
from mlflow.entities._mlflow_o... | 637 | 23,852 |
mlflow | mlflow/entities/trace_state.py | .py | from enum import Enum
from opentelemetry import trace as trace_api
from mlflow.protos import service_pb2 as pb
class TraceState(str, Enum):
"""Enum representing the state of a trace.
- ``STATE_UNSPECIFIED``: Unspecified trace state.
- ``OK``: Trace successfully completed.
- ``ERROR``: Trace encount... | 43 | 1,169 |
mlflow | mlflow/entities/logged_model_output.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import ModelOutput
class LoggedModelOutput(_MlflowObject):
"""ModelOutput object associated with a Run."""
def __init__(self, model_id: str, step: int) -> None:
self._model_id = model_id
self._step = step
... | 36 | 1,004 |
mlflow | mlflow/entities/assessment_error.py | .py | from dataclasses import dataclass
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.assessments_pb2 import AssessmentError as ProtoAssessmentError
_STACK_TRACE_TRUNCATION_PREFIX = "[Stack trace is truncated]\n...\n"
_STACK_TRACE_TRUNCATION_LENGTH = 10000
@dataclass
class AssessmentError(_M... | 78 | 2,498 |
mlflow | mlflow/entities/_job.py | .py | import json
from typing import Any
from mlflow.entities._job_status import JobStatus
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.utils.workspace_utils import resolve_entity_workspace_name
class Job(_MlflowObject):
"""
MLflow entity representing a Job.
"""
def __init__(
... | 122 | 3,616 |
mlflow | mlflow/entities/trace_data.py | .py | from collections import Counter
from dataclasses import dataclass, field
from typing import Any
from mlflow.entities import Span
from mlflow.tracing.constant import SpanAttributeKey
from mlflow.utils.annotations import deprecated
@dataclass
class TraceData:
"""A container object that holds the spans data of a tr... | 86 | 3,531 |
mlflow | mlflow/entities/gateway_guardrail.py | .py | from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.scorer import ScorerVersion
from mlflow.protos.service_pb2 import GatewayGuardrail as ProtoGatewayGuardrail
from mlflow.protos.service_pb2 import Gat... | 134 | 4,591 |
mlflow | mlflow/entities/__init__.py | .py | """
The ``mlflow.entities`` module defines entities returned by the MLflow
`REST API <../rest-api.html>`_.
"""
from mlflow.entities.assessment import (
Assessment,
AssessmentError,
AssessmentSource,
AssessmentSourceType,
Expectation,
Feedback,
IssueReference,
)
from mlflow.entities.dataset ... | 229 | 6,932 |
mlflow | mlflow/entities/logged_model_parameter.py | .py | import sys
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos import service_pb2 as pb2
class LoggedModelParameter(_MlflowObject):
"""
MLflow entity representing a parameter of a Model.
"""
def __init__(self, key, value):
if "pyspark.ml" in sys.modules:
i... | 47 | 1,140 |
mlflow | mlflow/entities/logged_model_tag.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos import service_pb2 as pb2
class LoggedModelTag(_MlflowObject):
"""Tag object associated with a Model."""
def __init__(self, key, value):
self._key = key
self._value = value
def __eq__(self, other):
if typ... | 34 | 850 |
mlflow | mlflow/entities/run.py | .py | from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.run_data import RunData
from mlflow.entities.run_info import RunInfo
from mlflow.entities.run_inputs import RunInputs
from mlflow.entities.run_outputs import RunOutputs
from mlflow.exceptions import MlflowException
fro... | 98 | 2,763 |
mlflow | mlflow/entities/link.py | .py | import base64
from dataclasses import dataclass
from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
@dataclass
class Link(_MlflowObject):
"""
Represents an OpenTelemetry Span Link that connects spans across traces.
Span Links allow you to link spans that don't have a parent-c... | 65 | 2,270 |
mlflow | mlflow/entities/view_type.py | .py | from mlflow.protos import service_pb2
class ViewType:
"""Enum to filter requested experiment types."""
ACTIVE_ONLY, DELETED_ONLY, ALL = range(1, 4)
_VIEW_TO_STRING = {
ACTIVE_ONLY: "active_only",
DELETED_ONLY: "deleted_only",
ALL: "all",
}
_STRING_TO_VIEW = {value: key for... | 52 | 1,816 |
mlflow | mlflow/entities/file_info.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import FileInfo as ProtoFileInfo
class FileInfo(_MlflowObject):
"""
Metadata about a file or directory.
"""
def __init__(self, path, is_dir, file_size):
self._path = path
self._is_dir = is_dir
... | 46 | 1,215 |
mlflow | mlflow/entities/run_data.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.metric import Metric
from mlflow.entities.param import Param
from mlflow.entities.run_tag import RunTag
from mlflow.protos.service_pb2 import Param as ProtoParam
from mlflow.protos.service_pb2 import RunData as ProtoRunData
from mlflow.protos... | 85 | 3,039 |
mlflow | mlflow/entities/assessment.py | .py | from __future__ import annotations
import json
import time
from dataclasses import dataclass
from typing import Any
from google.protobuf.json_format import MessageToDict, ParseDict
from google.protobuf.struct_pb2 import Value
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.assessment_er... | 708 | 27,670 |
mlflow | mlflow/entities/dataset_record_source.py | .py | from __future__ import annotations
import json
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
from mlflow.prot... | 127 | 4,181 |
mlflow | mlflow/entities/multipart_upload.py | .py | from dataclasses import dataclass
from typing import Any
from mlflow.protos.mlflow_artifacts_pb2 import (
CreateMultipartUpload as ProtoCreateMultipartUpload,
)
from mlflow.protos.mlflow_artifacts_pb2 import (
MultipartUploadCredential as ProtoMultipartUploadCredential,
)
@dataclass
class MultipartUploadPart... | 75 | 1,923 |
mlflow | mlflow/entities/source_type.py | .py | class SourceType:
"""Enum for originating source of a :py:class:`mlflow.entities.Run`."""
NOTEBOOK, JOB, PROJECT, LOCAL, UNKNOWN = range(1, 6)
_STRING_TO_SOURCETYPE = {
"NOTEBOOK": NOTEBOOK,
"JOB": JOB,
"PROJECT": PROJECT,
"LOCAL": LOCAL,
"UNKNOWN": UNKNOWN,
}
... | 32 | 1,168 |
mlflow | mlflow/entities/run_info.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.lifecycle_stage import LifecycleStage
from mlflow.entities.run_status import RunStatus
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
from mlflow.protos.service_pb2 import RunInf... | 187 | 5,898 |
mlflow | mlflow/entities/presigned_download.py | .py | from __future__ import annotations
from dataclasses import dataclass
from typing import Any
@dataclass
class PresignedDownloadUrlResponse:
"""
Response containing a presigned URL for downloading an artifact directly
from cloud storage.
"""
url: str
headers: dict[str, str]
file_size: int ... | 34 | 830 |
mlflow | mlflow/entities/trace_info_v2.py | .py | from dataclasses import asdict, dataclass, field
from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.assessment import Assessment
from mlflow.entities.trace_info import TraceInfo
from mlflow.entities.trace_location import TraceLocation
from mlflow.entities.trace_status ... | 159 | 6,083 |
mlflow | mlflow/entities/span.py | .py | import ast
import base64
import json
import logging
from functools import cached_property
from typing import Any, Union
from opentelemetry.proto.resource.v1.resource_pb2 import Resource as OTelProtoResource
from opentelemetry.proto.trace.v1.trace_pb2 import Span as OTelProtoSpan
from opentelemetry.proto.trace.v1.trace... | 1,499 | 60,678 |
mlflow | mlflow/entities/lifecycle_stage.py | .py | from mlflow.entities.view_type import ViewType
from mlflow.exceptions import MlflowException
class LifecycleStage:
ACTIVE = "active"
DELETED = "deleted"
_VALID_STAGES = {ACTIVE, DELETED}
@classmethod
def view_type_to_stages(cls, view_type=ViewType.ALL):
stages = []
if view_type in... | 36 | 1,202 |
mlflow | mlflow/entities/trace_metrics.py | .py | from dataclasses import dataclass
from enum import Enum
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos import service_pb2 as pb
class MetricViewType(str, Enum):
TRACES = "TRACES"
SPANS = "SPANS"
ASSESSMENTS = "ASSESSMENTS"
def __str__(self) -> str:
return self.va... | 98 | 2,979 |
mlflow | mlflow/entities/presigned_upload.py | .py | from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any
@dataclass
class CreatePresignedUploadResponse:
"""Response from creating a presigned upload URL."""
presigned_url: str
headers: dict[str, str] = field(default_factory=dict)
def to_proto(self):
... | 43 | 1,194 |
mlflow | mlflow/entities/experiment.py | .py | from __future__ import annotations
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.experiment_tag import ExperimentTag
from mlflow.entities.trace_location import UnityCatalog
from mlflow.protos.service_pb2 import Experiment as ProtoExperiment
from mlflow.protos.service_pb2 import Experime... | 182 | 6,729 |
mlflow | mlflow/entities/run_inputs.py | .py | from typing import Any
from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.entities.dataset_input import DatasetInput
from mlflow.entities.logged_model_input import LoggedModelInput
from mlflow.protos.service_pb2 import RunInputs as ProtoRunInputs
class RunInputs(_MlflowObject):
"""RunInputs obj... | 60 | 1,921 |
mlflow | mlflow/entities/_job_status.py | .py | from enum import Enum
from mlflow.exceptions import MlflowException
from mlflow.protos.jobs_pb2 import JobStatus as ProtoJobStatus
class JobStatus(str, Enum):
"""Enum for status of a Job."""
PENDING = "PENDING"
RUNNING = "RUNNING"
SUCCEEDED = "SUCCEEDED"
FAILED = "FAILED"
TIMEOUT = "TIMEOUT"... | 68 | 2,357 |
mlflow | mlflow/entities/input_tag.py | .py | from mlflow.entities._mlflow_object import _MlflowObject
from mlflow.protos.service_pb2 import InputTag as ProtoInputTag
class InputTag(_MlflowObject):
"""Input tag object associated with a dataset."""
def __init__(self, key: str, value: str) -> None:
self._key = key
self._value = value
... | 36 | 928 |
mlflow | mlflow/entities/session.py | .py | from __future__ import annotations
from typing import TYPE_CHECKING, Iterator
from mlflow.tracing.constant import TraceMetadataKey
if TYPE_CHECKING:
from mlflow.entities import Trace
class Session:
"""
A session object representing a group of traces that share the same session ID.
Sessions typical... | 47 | 1,233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.