cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch environmental variables saved in one notebook into another notebook in Databricks Repos and Notebooks

shubhamb
New Contributor III

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

3 REPLIES 3

Kaniz
Community Manager
Community Manager

Hi @Shubham Biswas​, Thanks for sharing the question with the community. Please look at the thread having a similar use case with a solution and numerous conversations around it. Please check it out and let us know if you found a resolution.

Kaniz
Community Manager
Community Manager

Hi @Shubham Biswas​, We haven’t heard from you on the last response from me​ , and I was checking back to see if my suggestions helped you. Or else, If you have any solution, please share it with the community as it can be helpful to others.

Anonymous
Not applicable

Hey there @Shubham Biswas​ 

Hope all is well!

Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.