Make the KedroContext available in the after_catalog_created hook #1576
antoinebon
started this conversation in
Idea
Replies: 2 comments 3 replies
-
So I don't think we'll do this - the context is being re-designed and may even cease to exist in the future. That being said you should be able to do the following which is basically what happens in the context anway: from pathlib import Path
from kedro.framework.startup import bootstrap_project
project_path = Path.cwd()
metadata = bootstrap_project(project_path) |
Beta Was this translation helpful? Give feedback.
3 replies
-
Since kedro 0.18.1 there's an exciting new hook,
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm writing a hook implementation that will dynamically add some datasets in the catalog once
after_catalog_created
. I need to have access to the KedroContext in the hook implementation in order to properly form absolute paths with thecontext._project_path
, however this is currently not available in that particular hook.I can go around this by adding a dummy dataset in the catalog.yaml and reverse engineer the project_path, however extending the hook to provide the context would be much cleaner. Do you think it makes sense?
Beta Was this translation helpful? Give feedback.
All reactions