Forum Discussion
Notebook default lakehouse error
- 1 year ago
Hi g3kuser,
Thanks for posting your query in Microsoft fabric community forum.The issue you're facing with the default Lakehouse when using notebook.runMultiple(). The error occurs because Notebook Main does not have a Lakehouse attached, and even though it isn't running Spark queries directly, it still manages the execution environment for child notebooks.
Try the following steps:
- Open Notebook Main. Attach a Lakehouse (either the same one as Notebook A or a temporary one). Save Notebook Main with this attached Lakehouse and Execute Notebook Main again.
- This will ensure that Notebook A inherits the necessary Lakehouse context, preventing the error.
If this helps, then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.
Hope this works for you!
Thank you.
Hello g3kuser
When you run Notebook A individually, it works because it dynamically attaches a default Lakehouse. However, when Notebook A is invoked from Notebook Main using notebook.runMultiple, the context of the default Lakehouse is not carried over, causing the error
Use the %%configure magic command to define the default Lakehouse programmatically at the start of Notebook A.
%%configure -f
{
"defaultLakehouse": {
"name": "<lakehouse_name>",
"id": "<lakehouse_id>",
"workspaceId": "<workspace_id>"
}
}
If this helps please accept the answer
Tried that but still got same error. I did further test and found if I attach the same default lakehouse to Notebook Main it works fine. Though this solved the error this solution doesn't work as Notebook Main is used only to create runmultiple dag and is used to call other notebook which may or may not need the same default lakehouse and can cause some other issues.
I set the default lakehouse for Notebook A from Notebook Main using sempy update notebook definition. This step occurs before runmultiple executions of Notebook A are invoked from Notebook Main.