A big problem I have with kedro is that there are ...
# beginners-need-help
a
A big problem I have with kedro is that there are no fixed value inputs for nodes. Consider the following node. It needs to know the name of the results that it's logging. This is fixed for the node that runs the function. For now, I have to use closure functions (such as
mlflow_log_model_closure
) to pin the name for the version of the function that will run. What's the better solution for this?
Copy code
def mlflow_log_model_results(name: str, res: pd.DataFrame):
    if not mlflow.active_run():
        return

    ...


def mlflow_log_model_closure(name: str):
    def closure(res: pd.DataFrame):
        return mlflow_log_model_results(name, res)

    closure.__name__ = f"log_{name}_model_results"
    return closure