normalize_tracking_uri#

openstef_models.integrations.mlflow.mlflow_storage.normalize_tracking_uri(uri: str, exceptions: Sequence[str] = []) str[source]#

Normalize a tracking URI to a file:/// URI when it refers to a local path.

MLflow’s model registry rejects bare Windows paths (e.g. D:\mlflow) because the drive letter is not a recognized URI scheme. This function detects local file paths — including relative ones like ./mlflow — and converts them to proper file:/// URIs via Path.resolve().as_uri().

URIs with recognized multi-character schemes (http, https, sqlite, …) pass through unchanged.

Parameters:
  • uri (str) – Raw tracking URI string, may be a path or a proper URI.

  • exceptions (Sequence[str]) – List of URI to treat as urls even if they have no scheme

  • uri

  • exceptions

Returns:

A file:/// URI for local paths, or the original URI for remote schemes.

Return type:

str