Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after_pipeline_run hook run_result is empty on successful run #4396

Open
Dekermanjian opened this issue Jan 2, 2025 · 1 comment
Open

after_pipeline_run hook run_result is empty on successful run #4396

Dekermanjian opened this issue Jan 2, 2025 · 1 comment
Labels
Community Issue/PR opened by the open-source community support: needs more info

Comments

@Dekermanjian
Copy link

Description

The run_result parameter is an empty dictionary when the pipeline runs and saves the output successfully.

Context

I am trying to get the pipeline outputs in a hook

Steps to Reproduce

in hooks.py:

    @hook_impl
    def after_pipeline_run(self, run_params, run_result, pipeline, catalog) -> None:
        logger = logging.getLogger(__name__)

        if run_params["pipeline_name"] == "data_processing":
            logger.info(f"run_params: {run_params}")
            logger.info(f"run_result: {run_result}")
            logger.info(f"pipeline: {pipeline}")
            logger.info(f"catalog: {catalog}")

Expected Result

run_result contains the pipeline output

Actual Result

run_result = {}

Your Environment

kedro version 0.19.10
python version 3.12.7
linux

@merelcht merelcht added the Community Issue/PR opened by the open-source community label Jan 2, 2025
@github-project-automation github-project-automation bot moved this to Wizard inbox in Kedro Wizard 🪄 Jan 2, 2025
@ankatiyar ankatiyar moved this from Wizard inbox to In Progress in Kedro Wizard 🪄 Feb 6, 2025
@ankatiyar
Copy link
Contributor

Hi @Dekermanjian,
The runner returns the "free outputs" i.e. MemoryDatasets that are not registered in the catalog. If there is a catalog entry for the output, then it is simply saved to the location specified in the catalog. Any particular reason why you need access to the data in the hook? I could suggest workarounds accordingly.
For example, you could try omitting the catalog entry for the dataset to access it in the after_pipeline_run hook or return a copy in the node as a MemoryDataset so it gets saved + is available in the hook.

@ankatiyar ankatiyar moved this from In Progress to Needs more info in Kedro Wizard 🪄 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Issue/PR opened by the open-source community support: needs more info
Projects
Status: Needs more info
Development

No branches or pull requests

4 participants