Why my notebook I created in a Repo can be opened safe?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2023 02:15 AM
I've cloned a Repo during "Get Started with Data Engineering on Databricks".
Then I'm trying to run another notebook from a cell with a magic %run command.
But I get that the file can't be opened safe.
Here my code:
notebook_a
name = "John"
print(f"Hello {name}")
%run ./notebook_b3
print(f"Welcome back John {full_name2}")
notebook_b3:
full_name2 = "Todorov"
Error
/databricks/python/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2807: UserWarning: Could not open file </Workspace/Repos/dnchankov@abv.bg/my_databricks_course/my_folder/notebook_b3> for safe execution.
warn('Could not open file <%s> for safe execution.' % fname)
NameError: name 'full_name2' is not defined
Thanks in advance!
🙂
- Labels:
-
Data Engineering
-
Notebooks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2023 06:05 AM
Hi @Dobromir Chankov
Great to meet you, and thanks for your question!
Let's see if your peers in the community have an answer to your question. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2023 10:39 AM
Opening in Confined Mode is the most secure choice and you can constantly resume the record in your unique Versus Code window once you decide the document is reliable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 01:22 AM
It could be that you need to put the %run in a cell all by itself.
Suggested here: https://stackoverflow.com/a/72833400/1144966

