{"record":{"id":"5a7ac6264cb3c394","repo":"mlflow/mlflow","slug":"version-is-only-supported-for-databricks-dataset","errorCode":null,"errorMessage":"`version` is only supported for Databricks datasets.","messagePattern":"`version` is only supported for Databricks datasets\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"mlflow/genai/datasets/__init__.py","lineNumber":395,"sourceCode":"            ]\n            dataset.merge_records(new_test_cases)\n    \"\"\"\n\n    if is_databricks_uri(get_tracking_uri()):\n        _validate_databricks_params(name, dataset_id)\n        resolved_version = _resolve_dataset_version_arg(version)\n        try:\n            from databricks.agents.datasets import get_dataset as db_get\n\n            with _databricks_profile_env():\n                if version is not None:\n                    return EvaluationDataset(db_get(name, version=resolved_version))\n                return EvaluationDataset(db_get(name))\n        except ImportError as e:\n            raise ImportError(_ERROR_MSG) from e\n    else:\n        if version is not None:\n            raise NotImplementedError(\"`version` is only supported for Databricks datasets.\")\n        _validate_non_databricks_get_params(name, dataset_id)\n\n        if name is not None:\n            return EvaluationDataset(_get_dataset_by_name(name))\n\n        return EvaluationDataset(MlflowClient().get_dataset(dataset_id))\n\n\ndef search_datasets(\n    experiment_ids: str | list[str] | None = None,\n    filter_string: str | None = None,\n    max_results: int | None = None,\n    order_by: list[str] | None = None,\n) -> list[EvaluationDataset]:\n    \"\"\"\n    Search for datasets.\n\n    .. warning::","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/genai/datasets/__init__.py#L377-L413","documentation":"The `version` parameter of mlflow.genai.datasets.get_dataset is only meaningful for Databricks-hosted evaluation datasets. On a non-Databricks (OSS) tracking URI, passing version != None raises NotImplementedError because OSS MLflowClient datasets have no version concept.","triggerScenarios":"Calling get_dataset(name=\"x\", version=2) while the tracking URI is a local file store, SQLite, or HTTP server (not databricks://).","commonSituations":"Porting Databricks notebook code to a self-hosted MLflow server; shared helper that always passes version.","solutions":["Drop the `version` argument when targeting an OSS MLflow backend","Only pass version when is_databricks_uri(mlflow.get_tracking_uri()) is True","Fetch by dataset_id (which implies a specific dataset) instead of name+version"],"exampleFix":"// before\nget_dataset(name=\"eval\", version=2)  # on OSS server\n// after\nif is_databricks_uri(mlflow.get_tracking_uri()):\n    get_dataset(name=\"eval\", version=2)\nelse:\n    get_dataset(name=\"eval\")","handlingStrategy":"validation","validationCode":"from mlflow.tracking._tracking_service.utils import is_databricks_uri\nfrom mlflow.tracking.fluent import get_tracking_uri\nassert version is None or is_databricks_uri(get_tracking_uri()), \"version only valid on Databricks\"","typeGuard":"def supports_version(version) -> bool:\n    return version is None or is_databricks_uri(get_tracking_uri())","tryCatchPattern":"try:\n    ds = mlflow.genai.datasets.get_dataset(name=\"eval\", version=ver)\nexcept NotImplementedError:\n    ds = mlflow.genai.datasets.get_dataset(name=\"eval\")","preventionTips":["Gate Databricks-only kwargs behind backend checks","Avoid copying version= from Databricks notebooks to OSS code"],"tags":["databricks","genai","datasets","version","not-implemented"],"backgroundTag":"databricks-unsupported-feature","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}