Kedro: Missing run_result in after_pipeline_run hook

Created on 20 Oct 2020  路  3Comments  路  Source: quantumblacklabs/kedro

Description

Missing run_result parameter in after_pipeline_run hook definition.

Context

I would like to implement my custom hook after_pipeline_run to retrieve the run_result, but program failed to execute once I implemented the hook with run_result: Dict[str, Any] parameter.

@hook_impl
    def after_pipeline_run(self, run_params: Dict[str, Any], run_result: Dict[str, Any], pipeline: Pipeline, catalog: DataCatalog) -> None:
        print(run_result, run_params)

Steps to Reproduce

  1. Implement after_pipeline_run
  2. Run kedro run
  3. Show {'run_result'} are declared in the hookimpl but can not be found in the hookspec error

Expected Result

Should be able to implement hook with run_result

Actual Result

Failed to implement hook with run_result since hook specification did not declare

-- If you received an error, place it here.
pluggy.manager.PluginValidationError: Plugin '2573623562696' for hook 'after_pipeline_run'
hookimpl definition: after_pipeline_run(run_params: Dict[str, Any], run_result: Dict[str, Any], pipeline: kedro.pipeline.pipeline.Pipeline, catalog: kedro.io.data_catalog.DataCatalog) -> None
Argument(s) {'run_result'} are declared in the hookimpl but can not be found in the hookspec

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

  • Kedro version used (pip show kedro or kedro -V): 0.16.5
  • Python version used (python -V): 3.7.9
  • Operating system and version: Windows 10
Bug Report

Most helpful comment

@applelok Thank you for reporting it! Looks like run_result is missing from a Hook spec. Let me quickly fix it.

All 3 comments

@applelok Thank you for reporting it! Looks like run_result is missing from a Hook spec. Let me quickly fix it.

Hi ! I had the same issue with run_params and journals. Is it possible to add them to Hook spec? I am looking to use run_params in after_catalog_created

Was this page helpful?
0 / 5 - 0 ratings