Skip to content

is_mlflow_enabled

kedro_dagster.utils.is_mlflow_enabled()

Check if MLflow is enabled in the Kedro context.

Returns

Type Description
bool

True if MLflow is enabled, False otherwise.

See Also

kedro_dagster.utils.get_mlflow_resource_from_config : Creates a Dagster resource when MLflow is enabled. kedro_dagster.utils.get_mlflow_run_url : Returns the MLflow UI URL for the active run.

Source Code

Show/Hide source
def is_mlflow_enabled() -> bool:
    """Check if MLflow is enabled in the Kedro context.

    Returns
    -------
    bool
        ``True`` if MLflow is enabled, ``False`` otherwise.

    See Also
    --------
    `kedro_dagster.utils.get_mlflow_resource_from_config` :
        Creates a Dagster resource when MLflow is enabled.
    `kedro_dagster.utils.get_mlflow_run_url` :
        Returns the MLflow UI URL for the active run.
    """
    try:
        import kedro_mlflow  # NOQA
        import mlflow  # NOQA

        return True
    except ImportError:
        return False