cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

I need to access the json file in the github repo from the databricks notebookI have a repo integrated with Databricks workspace. ย When I run %sh pwd ...

CK
New Contributor II

I need to access the json file in the github repo from the databricks notebook

I have a repo integrated with Databricks workspace.

When I run %sh pwd it returns this path /Workspace/Repos/chris@myemail/Repo/folder/test.json.

I'm not able to access the json file using this path.

2 REPLIES 2

SRK
Contributor III

I used the following code to read json file from this location and its working for me. Can you check if this works for you:

envconfigfilepath = "/Workspace/Repos/xyz@abc.io/Repo/notebooks/WF_Config/modify_config.json"

with open(envconfigfilepath) as json_data:

  env_object = json.load(json_data)

CK
New Contributor II

It works! Thank you, SRK!

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.