cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group