- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2026 04:19 AM
Hi @Saf4Databricks,
By default, variables are local to the notebook’s session and not visible elsewhere. Any sharing of variables across notebooks must be explicit. The main reason they aren’t shared is session isolation and implementation... Each notebook has its own interpreter process / REPL. In other words, each notebook has its own runtime.
Here is a reference you may find useful. Whilst it doesn't explicitly state that, the below note implies what I'm saying.
It's also worth noting that variables are ephemeral within the session... as in if the cluster/session is restarted or detached, they’re lost.
Also, variables and state are isolated between different language REPLs. For example, Python variables are not accessible in Scala cells.
Does that answer your question?
If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.
Ashwin | Delivery Solution Architect @ Databricks
Helping you build and scale the Data Intelligence Platform.
***Opinions are my own***