Giovanna Cavali
05/09/2024, 1:50 PMNok Lam Chan
05/09/2024, 1:52 PMGiovanna Cavali
05/09/2024, 1:55 PMGiovanna Cavali
05/09/2024, 1:55 PM%load_ext kedro.ipython
Nok Lam Chan
05/09/2024, 2:07 PMGiovanna Cavali
05/09/2024, 2:30 PMGiovanna Cavali
05/09/2024, 2:30 PMNok Lam Chan
05/09/2024, 2:37 PMNok Lam Chan
05/09/2024, 2:39 PMNok Lam Chan
05/09/2024, 2:40 PMGiovanna Cavali
05/09/2024, 2:46 PMGiovanna Cavali
05/09/2024, 2:50 PMGiovanna Cavali
05/09/2024, 2:50 PMNok Lam Chan
05/09/2024, 2:58 PMNok Lam Chan
05/09/2024, 2:58 PMNok Lam Chan
05/09/2024, 3:00 PMGiovanna Cavali
05/09/2024, 3:36 PMGiovanna Cavali
07/02/2024, 5:11 PMsession_id
as the rest of the pipeline, I was able to
• extract session_id
using hooks
• pass session_id
as a parameter to notebook using papermill
• and then creating a Kedro Session with a specific session_id
with the code bellow:
# Creating Kedro Session, Context and Catalog
from kedro.framework.session import KedroSession
from kedro.framework.startup import bootstrap_project
from pathlib import Path
import logging, sys
bootstrap_project(Path(".."))
session = KedroSession(session_id=session_id)
context = session.load_context()
catalog = context._get_catalog(save_version=session_id)
I wanted to check if there's any risk on forcing a session_id
, anything we should watch out for?Merel
07/08/2024, 4:47 PMKedroSession.create()
which doesn't take the session_id
argument. There's an open issue exactly for allowing this: https://github.com/kedro-org/kedro/issues/1731 There's no clear view on all the consequences of doing this, but the most important part is that the save_version
and session_id are connected.
context._get_catalog(save_version=session_id)
here you're also using private API.
Long story short: you can do all of the above, none of it is recommended and you have to take responsibility to make sure you're aware of the consequences of using private APIs (never do this in a production system if you can avoid it) 😅