0

I am using the Python Databricks REST API. I create folder in the workspace:

workspace_api = WorkspaceApi(api_client)    
workspace_api.mkdirs("/Users/xxxx/myfirstrepo")

Then, I checkout a repo:

repos_api = ReposApi(api_client)
repos_api.create("https://github.com/xxx","github","/Repos/xxx/freshRepo")

Now, I want to copy the content of the repo to the workspace folder myfirstrepo. How can I do this?

Thanks

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
user3579222
  • 1,103
  • 11
  • 28

1 Answers1

0

You can't do this as a single operation - these are different object types.

There are few approaches to that:

  • checkout the Git repository to the local disk and then use import_dir command from the Databricks CLI (doc)

  • list all files in repository, export each file with REST API export command, and then import it with corresponding REST API command

Alex Ott
  • 80,552
  • 8
  • 87
  • 132