How to fetch environmental variables saved in one notebook into another notebook in Databricks Repos and Notebooks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2022 10:30 PM
I have this config.py file which is used to store environmental variables
PUSH_API_ACCOUNT_ID = '*******'
PUSH_API_PASSCODE = '***********************'I am using this to fetch the variables and use it in my file.py
import sys
sys.path.append("..")
from folder import config
# create header for push API
headers = {
'Account-Id': PUSH_API_ACCOUNT_ID,
'Passcode': PUSH_API_PASSCODE,
'Content-Type': 'application/json',
}
#Push API url
url = "https://fetch.api.netscape.news.com/1/send/push.json"
#call API
response = requests.request("POST", url, headers=headers, data = data)How to do it in Repos and Workspace section
Labels:
- Labels:
-
Notebook