{"record":{"id":"6c2fbbe2330f02cb","repo":"mlflow/mlflow","slug":"digest-is-required","errorCode":null,"errorMessage":"digest is required","messagePattern":"digest is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mlflow/entities/evaluation_dataset.py","lineNumber":609,"sourceCode":"            \"last_updated_by\": self.last_updated_by,\n            \"experiment_ids\": self.experiment_ids,\n        })\n        if self.version is not None:\n            result[\"version\"] = self.version\n\n        result[\"records\"] = [record.to_dict() for record in self.records]\n\n        return result\n\n    @classmethod\n    def from_dict(cls, data: dict[str, Any]) -> \"EvaluationDataset\":\n        \"\"\"Create instance from dictionary representation.\"\"\"\n        if \"dataset_id\" not in data:\n            raise ValueError(\"dataset_id is required\")\n        if \"name\" not in data:\n            raise ValueError(\"name is required\")\n        if \"digest\" not in data:\n            raise ValueError(\"digest is required\")\n        if \"created_time\" not in data:\n            raise ValueError(\"created_time is required\")\n        if \"last_update_time\" not in data:\n            raise ValueError(\"last_update_time is required\")\n\n        dataset = cls(\n            dataset_id=data[\"dataset_id\"],\n            name=data[\"name\"],\n            digest=data[\"digest\"],\n            created_time=data[\"created_time\"],\n            last_update_time=data[\"last_update_time\"],\n            tags=data.get(\"tags\"),\n            schema=data.get(\"schema\"),\n            profile=data.get(\"profile\"),\n            created_by=data.get(\"created_by\"),\n            last_updated_by=data.get(\"last_updated_by\"),\n            version=data.get(\"version\"),\n        )","sourceCodeStart":591,"sourceCodeEnd":627,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/entities/evaluation_dataset.py#L591-L627","documentation":"from_dict() requires 'digest' as the third mandatory key; when dataset_id and name are present but digest is missing it raises ValueError('digest is required'). The digest is the content fingerprint MLflow uses for dataset identity and deduplication, so it cannot be reconstructed client-side from a partial dict.","triggerScenarios":"Calling EvaluationDataset.from_dict() with {'dataset_id': ..., 'name': ...} but no 'digest', typically dicts assembled by hand or produced by another tool's export format.","commonSituations":"Third-party export JSON lacking MLflow's digest field; manually editing a to_dict() output and deleting fields believed optional; caching serialized datasets without the digest.","solutions":["Include 'digest' in the dict; if unknown, fetch the dataset from the tracking store (search_datasets) and use its to_dict().","Round-trip from a real EvaluationDataset.to_dict() output.","Pre-validate the five required keys before calling from_dict()."],"exampleFix":"// before\ndata = {\"dataset_id\": \"d-123\", \"name\": \"eval\", \"created_time\": 1, \"last_update_time\": 1}\n\n// after\ndata = {\"dataset_id\": \"d-123\", \"name\": \"eval\", \"digest\": \"9f2c...\", \"created_time\": 1, \"last_update_time\": 1}","handlingStrategy":"validation","validationCode":"REQUIRED = (\"dataset_id\", \"name\", \"digest\", \"created_time\", \"last_update_time\")\nmissing = [k for k in REQUIRED if k not in data]\nif missing:\n    raise ValueError(f\"cannot hydrate dataset, missing: {missing}\")","typeGuard":"def is_complete_dataset_dict(data: dict) -> bool:\n    return all(isinstance(data.get(k), (str, int)) and data.get(k) is not None\n               for k in (\"dataset_id\", \"name\", \"digest\", \"created_time\", \"last_update_time\"))","tryCatchPattern":"try:\n    ds = EvaluationDataset.from_dict(data)\nexcept ValueError as e:\n    if \"digest is required\" in str(e):\n        from mlflow.tracking import MlflowClient\n        remote = next(d for d in MlflowClient().search_datasets() if d.dataset_id == data[\"dataset_id\"])\n        ds = EvaluationDataset.from_dict(remote.to_dict())\n    else:\n        raise","preventionTips":["Never strip 'digest' when exporting datasets from external tools; fetch it from the store if unknown.","Round-trip only real to_dict() output.","Validate all five required keys before from_dict() in import pipelines."],"tags":["python","deserialization","missing-field"],"backgroundTag":"missing-required-field","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}