Reitse's avatar
Reitse
Icon for Most Valuable Professional rankMost Valuable Professional
3 months ago
Status:
New

Reference notebooks in different workspaces using the %run magic command

In our current architecture, we have several workspaces with specific workloads. One of the workloads is central management of functions, variables, an orchestration database, etc. 

 

When we run notebooks, we import them using %run "NB WhateverTheNameIs". This works excellent, as long as the notebook is in the same workspace. Things change when the notebook is in a different workspace. Using the notebookutils.notebook.run library seemed like a great idea, until I found out that this only works for returning values, not when I need to import functions.

 

So, here's the idea, upgrade %run to %run ("NB WhateverTheNameIS", "Workspace ID"). This works similar to what the notebookutils library does, only more fitting to my, and probably other people's as well, use cases.

No CommentsBe the first to comment

Recent ideas