Richard Purvis
08/14/2024, 8:43 PMbefore_pipeline_run
spec to load run_params
. However, for some reason the run_params
dictionary is empty (I would like to use the pipeline_name
key). I'm checking this via a debugging session after calling kedro in the CLI, and also looking at the hook outputs. I'm wondering how else I could troubleshoot this? I'm using kedro 0.19.3.Nok Lam Chan
08/14/2024, 10:59 PMNok Lam Chan
08/14/2024, 11:02 PMpipeline_name
is None
it's using __default__
, you can confirm this with kedro run -p <some_pipeline>
name = pipeline_name or "__default__"
record_data = {
"session_id": session_id,
"project_path": self._project_path.as_posix(),
"env": context.env,
"kedro_version": kedro_version,
"tags": tags,
"from_nodes": from_nodes,
"to_nodes": to_nodes,
"node_names": node_names,
"from_inputs": from_inputs,
"to_outputs": to_outputs,
"load_versions": load_versions,
"extra_params": extra_params,
"pipeline_name": pipeline_name,
"namespace": namespace,
"runner": getattr(runner, "__name__", str(runner)),
}
Nok Lam Chan
08/14/2024, 11:03 PMpipeline_name=None
then it use __default__
Nok Lam Chan
08/14/2024, 11:03 PMRichard Purvis
08/15/2024, 1:53 AMRichard Purvis
08/15/2024, 1:53 AMRichard Purvis
08/15/2024, 4:17 PMclass DummyHooks:
@hook_impl
def before_pipeline_run(self, run_params: Dict[str, Any] = dict()):
breakpoint()
print(run_params)
Nok Lam Chan
08/15/2024, 4:30 PMNok Lam Chan
08/15/2024, 4:30 PMRichard Purvis
08/15/2024, 5:16 PMRichard Purvis
08/15/2024, 5:17 PMRichard Purvis
08/15/2024, 5:18 PMclass DummyHooks:
@hook_impl
def before_pipeline_run(self, run_params: Dict[str, Any]):
breakpoint()
print(run_params)
Richard Purvis
08/15/2024, 5:19 PMNok Lam Chan
08/15/2024, 5:22 PMdict
/`list` in argument is not advised ( an anti-pattern in Python). What you should do is instead:
if not arg:
arg = dict()
Although it's also not clear to me why this override pluggy
in this case.Nok Lam Chan
08/15/2024, 6:12 PMclass DummyHooks:
@hook_impl
def before_pipeline_run(self, run_params: Dict[str, Any] = 'dummy'):
breakpoint()
print(run_params)
I change this example, and seems that if you give a value to the argument, pluggy
no longer treat it as a hook argument for some reason.Nok Lam Chan
08/15/2024, 6:26 PMFurthermore, each hookimpl or hookspec decorator can configure the underlying call-time behavior of each hook object by providing special options passed as keyword arguments.https://pluggy.readthedocs.io/en/stable/#marking-hooks It seems like keywords argument are expected to be call-time behavior so it may be reserved for something else. The docs didn't mention this explicitly so I am not sure. I am following up with an issue here: https://github.com/pytest-dev/pluggy/issues/522
Nok Lam Chan
08/16/2024, 4:22 PMRichard Purvis
08/16/2024, 8:54 PM