def METHOD_NAME(constructor_fn: callable, constructor_name: str):
    if not constructor_name.startswith("load_") and not constructor_name.startswith("from_"):
        raise MlflowException(
            f"Invalid dataset constructor name: {constructor_name}."
            f" Constructor name must start with 'load_' or 'from_'.",
            INVALID_PARAMETER_VALUE,
        )
    signature = inspect.signature(constructor_fn)
    parameters = signature.parameters
    for expected_kwarg in ["name", "digest"]:
        if expected_kwarg not in parameters or parameters[expected_kwarg].kind not in [
            inspect.Parameter.KEYWORD_ONLY,
            inspect.Parameter.POSITIONAL_OR_KEYWORD,
        ]:
            raise MlflowException(
                f"Invalid dataset constructor function: {constructor_fn.__name__}. Function"
                f" must define an optional parameter named '{expected_kwarg}'.",
                INVALID_PARAMETER_VALUE,
            )
    if not issubclass(signature.return_annotation, Dataset):
        raise MlflowException(
            f"Invalid dataset constructor function: {constructor_fn.__name__}. Function must"
            f" have a return type annotation that is a subclass of"
            f" :py:class:`mlflow.data.dataset.Dataset`.",
            INVALID_PARAMETER_VALUE,
        )