Skip to content

Eager imports of mlflow cause cascading failures on Windows #284

@ClayGendron

Description

@ClayGendron

Problem

databricks_langchain imports mlflow eagerly at module level in genie.py:3, which triggers mlflow's entire import chain including pyspark. This causes failures on Windows due to pyspark 4.x incompatibility.

Import chain

from databricks_langchain import ChatDatabricks
  → databricks_langchain.genie imports mlflow
  → mlflow.types.schema imports pyspark
  → pyspark crashes on Windows (UnixStreamServer)

Environment

  • Windows 11
  • Python 3.13.3
  • databricks-langchain==0.11.0
  • mlflow==2.22.4
  • pyspark==4.1.1

Suggested fix

Lazy-load mlflow only when GenieAgent is actually used, not at module import time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions