Hello! I ran into an issue when trying to do the f...
# questions
j
Hello! I ran into an issue when trying to do the following on a Databricks' Workflow run executing code in a DevOps repository:
with KedroSession.create(
project_path=project_root,
extra_params=extra_params,
) as session:
session.run(kedro_pipeline_to_launch)
It seems that the default value for the class `KedroSession`parameter
save_on_close
is
False
while the default value for the
.create
method for the same parameter is set to
True
. This is easy to fix as it is just a matter of explicitly passing the parameter, but it seems contradictory. Is there a reason for keeping these two defaults different? Thanks!
👀 1
l
Hey Juan, is there anything specific you are trying to do where this difference in the defaults is causing an issue?
t
Might not be relevant, but when I'm running kedro on databricks I load the session using:
Copy code
%load_ext kedro.ipython
%reload_kedro project_root --env=s3_dev
This creates the global session variable in the notebook and then I use session.run etc. Could be a work around for your issue if it's to do with your method of defining the session?
n
Can you elaborate what is the problem here or do you just need some clarification? The standard way of creating KedroSession is through the factory method "create". I do not know what the init method have a different default. I suspect it's mostly legacy code. In fact the session save method do less than it used to be. It's likely not important but something that we should revisit when we start the redesign work of KedroSession
https://github.com/kedro-org/kedro/milestone/46 There is a milestone about it but we haven't started any work yet.