Ramya
New Contributor III

Hi All,

I tried the same code but it's not working for me. I keep getting

 import_workspace() got an unexpected keyword argument 'format'.

token_credential = DefaultAzureCredential()

scope = "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default"

token = token_credential.get_token(scope)

access_token = str(token.token)

from databricks_cli.workspace.api import WorkspaceApi

from databricks_cli.sdk.api_client import ApiClient

client = ApiClient(

  host='https://your.databricks-url.net',

  token=access_token

)

workspace_api = WorkspaceApi(client)

workspace_api.import_workspace(

  source_path="/home/hello.py",

  target_path="/repo/test/hello.py",

  language="PYTHON",

  format = "SOURCE"

)