{"record":{"id":"a11ee372dd9bef47","repo":"mlflow/mlflow","slug":"invalid-parameter-value-a11ee3","errorCode":"INVALID_PARAMETER_VALUE","errorMessage":"Invalid dataset constructor name: {constructor_name}. Constructor name must start with 'load_' or 'from_'.","messagePattern":"Invalid dataset constructor name: (.+?)\\. Constructor name must start with 'load_' or 'from_'\\.","errorType":"error_code","errorClass":"MlflowException","httpStatus":400,"severity":"error","filePath":"mlflow/data/dataset_registry.py","lineNumber":70,"sourceCode":"        for entrypoint in get_entry_points(\"mlflow.dataset_constructor\"):\n            try:\n                self.register_constructor(\n                    constructor_fn=entrypoint.load(), constructor_name=entrypoint.name\n                )\n            except Exception as exc:\n                warnings.warn(\n                    f\"Failure attempting to register dataset constructor\"\n                    f' \"{entrypoint.name}\": {exc}.',\n                    stacklevel=2,\n                )\n\n    @staticmethod\n    def _validate_constructor(\n        constructor_fn: Callable[[str | None, str | None], Dataset],\n        constructor_name: str,\n    ):\n        if not constructor_name.startswith(\"load_\") and not constructor_name.startswith(\"from_\"):\n            raise MlflowException(\n                f\"Invalid dataset constructor name: {constructor_name}.\"\n                f\" Constructor name must start with 'load_' or 'from_'.\",\n                INVALID_PARAMETER_VALUE,\n            )\n\n        signature = inspect.signature(constructor_fn)\n        parameters = signature.parameters\n        for expected_kwarg in [\"name\", \"digest\"]:\n            if expected_kwarg not in parameters or parameters[expected_kwarg].kind not in [\n                inspect.Parameter.KEYWORD_ONLY,\n                inspect.Parameter.POSITIONAL_OR_KEYWORD,\n            ]:\n                raise MlflowException(\n                    f\"Invalid dataset constructor function: {constructor_fn.__name__}. Function\"\n                    f\" must define an optional parameter named '{expected_kwarg}'.\",\n                    INVALID_PARAMETER_VALUE,\n                )\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/data/dataset_registry.py#L52-L88","documentation":"When registering a dataset constructor with DatasetRegistry.register_constructor, the name must start with 'load_' or 'from_' so it reads like a factory method on mlflow.data. Registering e.g. 'get_my_data' fails validation with INVALID_PARAMETER_VALUE. This enforces the public API convention that dataset builders are accessed as mlflow.data.load_* or from_*.","triggerScenarios":"Calling registry.register_constructor(constructor_fn, constructor_name) where constructor_name does not begin with 'load_' or 'from_', e.g. 'fetch_data' or 'MyDatasetBuilder'.","commonSituations":"Teams building custom dataset factories for internal data lakes and naming the entry point after their business function rather than the load_/from_ convention.","solutions":["Rename the constructor name to start with 'load_' (e.g. 'load_internal_dataset') or 'from_' (e.g. 'from_spark_table').","Keep the function name itself and pass a compliant constructor_name string to register_constructor."],"exampleFix":"// before\nregistry.register_constructor(my_loader, \"my_data\")\n// after\nregistry.register_constructor(my_loader, \"load_my_data\")","handlingStrategy":"validation","validationCode":"assert constructor_name.startswith((\"load_\", \"from_\")), f\"{constructor_name} must start with load_ or from_\"","typeGuard":null,"tryCatchPattern":"try:\n    registry.register_constructor(fn, name)\nexcept MlflowException as e:\n    if \"must start with 'load_'\" in str(e):\n        registry.register_constructor(fn, f\"load_{name}\")","preventionTips":["Adopt the load_/from_ naming convention for all custom dataset factories","Validate names in CI before registering","Wrap registration in a helper that normalizes the name prefix"],"tags":["validation","naming","dataset-registry","mlflow"],"backgroundTag":"invalid-parameter-value","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}