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 from mlflow.utils.databricks_utils import is_in_databricks_runtime from mlflow.utils.uri import is_http_uri _logger = logging.getLogger(__name__) if TYPE_CHECKING: from mlflow.entities import Trace TRACE_RENDERER_ASSET_PATH = "/static-files/lib/notebook-trace-renderer/index.html" IFRAME_HTML = """