---
title: Databricks SDK for Python
description: Learn how to use the Databricks SDK for Python to automate Databricks operations using Python.
canonical_url: https://docs.databricks.com/aws/en/dev-tools/sdk-python
---

# Databricks SDK for Python

> [!NOTE]
>
> Databricks recommends Declarative Automation Bundles for creating, developing, deploying, and testing jobs and other Databricks resources as source code. See [What are Declarative Automation Bundles?](https://docs.databricks.com/aws/en/dev-tools/bundles/index.md).

In this article, you learn how to automate Databricks operations and accelerate development with the [Databricks SDK for Python](https://pypi.org/project/databricks-sdk/). This article supplements the Databricks SDK for Python [documentation](https://databricks-sdk-py.readthedocs.io) on Read The Docs and the [code examples](https://github.com/databricks/databricks-sdk-py/tree/main/examples) in the Databricks SDK for Python repository in GitHub.

> [!NOTE]
>
> The Databricks SDK for Python is in [Beta](https://docs.databricks.com/aws/en/release-notes/release-types.md) and is okay to use in production.
>
> During the Beta period, Databricks recommends that you pin a dependency on the specific minor version of the Databricks SDK for Python that your code depends on. For example, you can pin dependencies in files such as `requirements.txt` for `venv`, or `pyproject.toml` and `poetry.lock` for Poetry. For more information about pinning dependencies, see [Virtual Environments and Packages](https://docs.python.org/3/tutorial/venv.html) for `venv`, or [Installing dependencies](https://python-poetry.org/docs/basic-usage/#installing-dependencies) for Poetry.

## Requirements

You can use the Databricks SDK for Python from within a Databricks notebook or from your local development machine.

* To use the Databricks SDK for Python from within a Databricks notebook, skip ahead to [Use the Databricks SDK for Python from a Databricks notebook](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#notebook).
* To use the Databricks SDK for Python from your local development machine, complete the steps in this section.

To use the Databricks SDK for Python, your development machine must have:

* Databricks [authentication](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#authentication) configured.
* [Python](https://www.python.org/) 3.8 or higher installed. For automating Databricks compute resources, Databricks recommends that you have the major and minor versions of Python installed that match the one that is installed on your target Databricks compute resource. This article's examples rely on automating clusters with Databricks Runtime 13.3 LTS, which has Python 3.10 installed. For the correct version, see [Databricks Runtime release notes versions and compatibility](https://docs.databricks.com/aws/en/release-notes/runtime/index.md) for your cluster's Databricks Runtime version.
* Databricks recommends that you create and activate a Python *virtual environment* for each Python project that you use with the Databricks SDK for Python. Python virtual environments help to make sure that your code project is using compatible versions of Python and Python packages (in this case, the Databricks SDK for Python package). For more information on Python virtual environments, see [venv](https://docs.python.org/3/library/venv.html) or [Poetry](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment).

## <a id="get-started" />Get started with the Databricks SDK for Python

This section describes how to get started with the Databricks SDK for Python from your local development machine. To use the Databricks SDK for Python from within a Databricks notebook, skip ahead to [Use the Databricks SDK for Python from a Databricks notebook](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#notebook).

1. On your development machine with Databricks authentication configured, Python already installed, and your Python virtual environment already activated, install the [databricks-sdk](https://pypi.org/project/databricks-sdk/) package (and its dependencies) from the Python Package Index (PyPI), as follows:

   ### Venv

   Use `pip` to install the `databricks-sdk` package. (On some systems, you might need to replace `pip3` with `pip`, here and throughout.)

   ```bash
   pip3 install databricks-sdk
   ```

   ### Poetry

   ```bash
   poetry add databricks-sdk
   ```

   To install a specific version of the `databricks-sdk` package while the Databricks SDK for Python is in Beta, see the package's [Release history](https://pypi.org/project/databricks-sdk/#history). For example, to install version `0.1.6`:

   ### Venv

   ```bash
   pip3 install databricks-sdk==0.1.6
   ```

   ### Poetry

   ```bash
   poetry add databricks-sdk==0.1.6
   ```

   To upgrade an existing installation of the Databricks SDK for Python package to the latest version, run the following command:

   ### Venv

   ```bash
   pip3 install --upgrade databricks-sdk
   ```

   ### Poetry

   ```bash
   poetry add databricks-sdk@latest
   ```

   To show the Databricks SDK for Python package's current `Version` and other details, run the following command:

   ### Venv

   ```bash
   pip3 show databricks-sdk
   ```

   ### Poetry

   ```bash
   poetry show databricks-sdk
   ```

2. In your Python virtual environment, create a Python code file that imports the Databricks SDK for Python. The following example, in a file named `main.py` with the following contents, simply lists all the clusters in your Databricks workspace:

   ```python
   from databricks.sdk import WorkspaceClient

   w = WorkspaceClient()

   for c in w.clusters.list():
     print(c.cluster_name)
   ```

3. Run your Python code file, assuming a file named `main.py`, by running the `python` command:

   ### Venv

   ```bash
   python3.10 main.py
   ```

   ### Poetry

   If you are in the virtual environment's shell:

   ```bash
   python3.10 main.py
   ```

   If you are not in the virtual environment's shell:

   ```bash
   poetry run python3.10 main.py
   ```

   > [!NOTE]
   >
   > By not setting any arguments in the preceding call to `w = WorkspaceClient()`, the Databricks SDK for Python uses its default process for trying to perform Databricks authentication. To override this default behavior, see the following [authentication](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#authentication) section.

## <a id="authentication" />Authenticate the Databricks SDK for Python with your Databricks account or workspace

This section describes how to authenticate the Databricks SDK for Python from your local development machine over to your Databricks account or workspace. To authenticate the Databricks SDK for Python from within a Databricks notebook, skip ahead to [Use the Databricks SDK for Python from a Databricks notebook](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#notebook).

The Databricks SDK for Python implements the *Databricks unified authentication* standard, a consolidated and consistent architectural and programmatic approach to authentication. This approach helps make setting up and automating authentication with Databricks more centralized and predictable. It enables you to configure Databricks authentication once and then use that configuration across multiple Databricks tools and SDKs without further authentication configuration changes. For more information, including more complete code examples in Python, see [Databricks unified authentication](https://docs.databricks.com/aws/en/dev-tools/auth/unified-auth.md).

Some of the available coding patterns to initialize Databricks authentication with the Databricks SDK for Python include:

* Use Databricks default authentication by doing one of the following:

  * Create or identify a custom [Databricks configuration profile](https://docs.databricks.com/aws/en/dev-tools/auth/config-profiles.md) with the required fields for the target Databricks authentication type. Then set the `DATABRICKS_CONFIG_PROFILE` environment variable to the name of the custom configuration profile.
  * Set the required environment variables for the target Databricks authentication type.

  Then instantiate for example a `WorkspaceClient` object with Databricks default authentication as follows:

  ```python
  from databricks.sdk import WorkspaceClient

  w = WorkspaceClient()
  # ...
  ```

* Hard-coding the required fields is supported but not recommended, as it risks exposing sensitive information in your code, such as Databricks personal access tokens. The following example hard-codes Databricks host and access token values for Databricks token authentication:

  ```python
  from databricks.sdk import WorkspaceClient

  w = WorkspaceClient(
    host = 'https://...',
    token = '...'
  )
  # ...
  ```

See also [Authentication](https://databricks-sdk-py.readthedocs.io/en/latest/authentication.html) in the Databricks SDK for Python documentation.

## <a id="notebook" />Use the Databricks SDK for Python from a Databricks notebook

You can call Databricks SDK for Python functionality from a Databricks notebook that has an attached Databricks cluster with the Databricks SDK for Python installed. It is installed by default on all Databricks clusters that use Databricks Runtime 13.3 LTS or above. For Databricks clusters that use Databricks Runtime 12.2 LTS and below, you must install the Databricks SDK for Python first. See [Step 1: Install or upgrade the Databricks SDK for Python](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#install-sdk-cluster).

To see the Databricks SDK for Python version that is installed for a specific Databricks Runtime version, see the *Installed Python libraries* section of the [Databricks Runtime release notes](https://docs.databricks.com/aws/en/release-notes/runtime/index.md) for that version.

Databricks recommends that you install the latest available version of the SDK from [PiPy](https://pypi.org/project/databricks-sdk/), but at a minimum install or upgrade to Databricks SDK for Python 0.6.0 or above, as default Databricks notebook authentication is used by version 0.6.0 and above on all Databricks Runtime versions.

> [!NOTE]
>
> Databricks Runtime 15.1 is the first Databricks Runtime to have a version of the Databricks SDK for Python (0.20.0) installed that supports default notebook authentication with no upgrade required.

The following table outlines notebook authentication support for Databricks SDK for Python and Databricks Runtime versions:

| SDK/Databricks Runtime | 10.4 LTS | 11.3 LTS | 12.3 LTS | 13.3 LTS | 14.3 LTS | 15.1 and above |
| ---------------------- | -------- | -------- | -------- | -------- | -------- | -------------- |
| **0.1.7 and below**    |          |          |          |          |          |                |
| **0.1.10**             |          | ✓        | ✓        | ✓        | ✓        | ✓              |
| **0.6.0**              | ✓        | ✓        | ✓        | ✓        | ✓        | ✓              |
| **0.20.0 and above**   | ✓        | ✓        | ✓        | ✓        | ✓        | ✓              |

Default Databricks notebook authentication relies on a temporary Databricks personal access token that Databricks automatically generates in the background for its own use. Databricks deletes this temporary token after the notebook stops running.

> [!IMPORTANT]
>
> * Default Databricks notebook authentication works only on the cluster's driver node and not on any of the cluster's worker or executor nodes.
> * Databricks notebook authentication does not work with Databricks configuration profiles.
> * Databricks notebook authentication does not work with [Databricks Container Services](https://docs.databricks.com/aws/en/compute/custom-containers.md#limitations).

If you want to call Databricks [account-level](https://docs.databricks.com/api/account) APIs or if you want to use a Databricks authentication type other than default Databricks notebook authentication, the following authentication types are also supported:

| Authentication type                                                                                             | Databricks SDK for Python versions |
| --------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| [OAuth machine-to-machine (M2M) authentication](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m.md) | All versions                       |
| [OAuth user-to-machine (U2M) authentication](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-u2m.md)    | 0.1.9 and above                    |
| [Databricks personal access token authentication](https://docs.databricks.com/aws/en/dev-tools/auth/pat.md)     | All versions                       |

### <a id="install-sdk-cluster" />Step 1: Install or upgrade the Databricks SDK for Python

> [!NOTE]
>
> Databricks SDK for Python is installed by default on all Databricks clusters that use Databricks Runtime 13.3 LTS or above.

1. Databricks Python notebooks can use the Databricks SDK for Python just like any other Python library. To install or upgrade the Databricks SDK for Python library on the attached Databricks cluster, run the `%pip` magic command from a notebook cell as follows:

   ```python
   %pip install databricks-sdk --upgrade
   ```

2. After you run the `%pip` magic command, you must restart Python to make the installed or upgraded library available to the notebook. To do this, run the following command from a notebook cell immediately after the cell with the `%pip` magic command:

   ```python
   dbutils.library.restartPython()
   ```

3. To display the installed version of the Databricks SDK for Python, run the following command from a notebook cell:

   ```python
   %pip show databricks-sdk | grep -oP '(?<=Version: )\S+'
   ```

### Step 2: Run your code

In your notebook cells, create Python code that imports and then calls the Databricks SDK for Python. The following example uses default Databricks notebook authentication to list all the clusters in your Databricks workspace:

```python
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

for c in w.clusters.list():
  print(c.cluster_name)
```

When you run this cell, a list of the names of all of the available clusters in your Databricks workspace appears.

To use a different Databricks authentication type, see [Authorization methods](https://docs.databricks.com/aws/en/dev-tools/auth/index.md#auth-types) and click the corresponding link for additional technical details.

## <a id="dbutils" />Use Databricks Utilities

You can use [Databricks Utilities](https://docs.databricks.com/aws/en/dev-tools/databricks-utils.md) from Databricks SDK for Python code running on your local development machine or from within a Databricks notebook.

* From your local development machine, Databricks Utilities has access only to the `dbutils.fs`, `dbutils.secrets`, `dbutils.widgets`, and `dbutils.jobs` command groups.
* From a Databricks notebook that is attached to a Databricks cluster, Databricks Utilities has access to all of the available Databricks Utilities command groups, but the `dbutils.notebook` command group is limited to two levels of commands only, for example `dbutils.notebook.run` or `dbutils.notebook.exit`.

To call Databricks Utilities from either your local development machine or a Databricks notebook, use `dbutils` within `WorkspaceClient`. This code example uses default Databricks notebook authentication to call `dbutils` within `WorkspaceClient` to list the paths of all of the objects in the DBFS root of the workspace.

```python
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()
d = w.dbutils.fs.ls('/')

for f in d:
  print(f.path)
```

Alternatively, you can call `dbutils` directly. However, you are limited to using default Databricks notebook authentication only. This code example calls `dbutils` directly to list all of the objects in the DBFS root of the workspace.

```python
from databricks.sdk.runtime import *

d = dbutils.fs.ls('/')

for f in d:
  print(f.path)
```

To access Unity Catalog [volumes](https://docs.databricks.com/aws/en/volumes/index.md), use `files` within `WorkspaceClient`. See [Manage files in Unity Catalog volumes](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#files-in-volumes). You cannot use `dbutils` by itself or within `WorkspaceClient` to access volumes.

See also [Interaction with dbutils](https://github.com/databricks/databricks-sdk-py#interaction-with-dbutils).

## Code examples

The following code examples demonstrate how to use the Databricks SDK for Python to create and delete clusters, run jobs, and list account-level groups. These code examples use default Databricks notebook authentication. For details about default Databricks notebook authentication, see [Use the Databricks SDK for Python from a Databricks notebook](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#notebook). For details about default authentication outside of notebooks, see [Authenticate the Databricks SDK for Python with your Databricks account or workspace](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#authentication).

For additional code examples, see the [examples](https://github.com/databricks/databricks-sdk-py/tree/main/examples) in the Databricks SDK for Python repository in GitHub. See also:

* [Databricks Workspace APIs reference](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/index.html)
* [Databricks Account APIs reference](https://databricks-sdk-py.readthedocs.io/en/latest/account/index.html)

- [Create a cluster](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#create-a-cluster)
- [Permanently delete a cluster](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#permanently-delete-a-cluster)
- [Create a job](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#create-a-job)
- [Create a job that uses serverless compute](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#create-a-job-that-uses-serverless-compute)
- [Manage files in Unity Catalog volumes](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#manage-files-in-unity-catalog-volumes)
- [List account-level groups](https://docs.databricks.com/aws/en/dev-tools/sdk-python.md#list-account-level-groups)

### Create a cluster

This code example creates a cluster with the specified Databricks Runtime version and cluster node type. This cluster has one worker, and the cluster will automatically terminate after 15 minutes of idle time.

```python
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

print("Attempting to create cluster. Please wait...")

c = w.clusters.create_and_wait(
  cluster_name = 'my-cluster',
  spark_version = '12.2.x-scala2.12',
  node_type_id = 'i3.xlarge',
  autotermination_minutes = 15,
  num_workers = 1
)

print(f"The cluster is now ready at " \
      f"{w.config.host}#setting/clusters/{c.cluster_id}/configuration\n")
```

### Permanently delete a cluster

This code example permanently deletes the cluster with the specified cluster ID from the workspace.

```python
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

c_id = input('ID of cluster to delete (for example, 1234-567890-ab123cd4): ')

w.clusters.permanent_delete(cluster_id = c_id)
```

### Create a job

This code example creates a Databricks job that runs the specified notebook on the specified cluster. As the code runs, it gets the existing notebook's path, the existing cluster ID, and related job settings from the user at the terminal.

```python
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.jobs import Task, NotebookTask, Source

w = WorkspaceClient()

job_name = input("Some short name for the job (for example, my-job): ")
description = input("Some short description for the job (for example, My job): ")
existing_cluster_id = input("ID of the existing cluster in the workspace to run the job on (for example, 1234-567890-ab123cd4): ")
notebook_path = input("Workspace path of the notebook to run (for example, /Users/someone@example.com/my-notebook): ")
task_key = input("Some key to apply to the job's tasks (for example, my-key): ")

print("Attempting to create the job. Please wait...\n")

j = w.jobs.create(
  name = job_name,
  tasks = [
    Task(
      description = description,
      existing_cluster_id = existing_cluster_id,
      notebook_task = NotebookTask(
        base_parameters = dict(""),
        notebook_path = notebook_path,
        source = Source("WORKSPACE")
      ),
      task_key = task_key
    )
  ]
)

print(f"View the job at {w.config.host}/#job/{j.job_id}\n")
```

### Create a job that uses serverless compute

The following example creates a job that uses [Serverless Compute for Jobs](https://docs.databricks.com/aws/en/jobs/run-serverless-jobs.md):

```python
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.jobs import NotebookTask, Source, Task

w = WorkspaceClient()

j = w.jobs.create(
  name = "My Serverless Job",
  tasks = [
    Task(
      notebook_task = NotebookTask(
      notebook_path = "/Users/someone@example.com/MyNotebook",
      source = Source("WORKSPACE")
      ),
      task_key = "MyTask",
   )
  ]
)
```

### <a id="files-in-volumes" />Manage files in Unity Catalog volumes

This code example demonstrates various calls to the `files` functionality within `WorkspaceClient` to access a Unity Catalog [volume](https://docs.databricks.com/aws/en/volumes/index.md). For more information, see the [complete SDK docs](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/files/files.html#w-files-files).

The Databricks SDK for Python provides two ways to upload and download files. `upload_from` and `download_to` are recommended for local file paths. `upload` and `download` are recommended for data in memory and stream interfaces. All four methods support files up to the maximum size supported by the underlying cloud storage when using SDK v0.72.0 or newer.

```python
from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

# Define volume, folder, and file details.
catalog = 'main'
schema = 'default'
volume = 'my-volume'
volume_path = f"/Volumes/{catalog}/{schema}/{volume}" # /Volumes/main/default/my-volume
volume_folder = 'my-folder'
volume_folder_path = f"{volume_path}/{volume_folder}" # /Volumes/main/default/my-volume/my-folder
volume_file = 'data.csv'
volume_file_path = f"{volume_folder_path}/{volume_file}" # /Volumes/main/default/my-volume/my-folder/data.csv
upload_file_path = './data.csv'

# Create an empty folder in a volume.
w.files.create_directory(volume_folder_path)

# Upload a file to a volume (method 1: recommended when your data is in a local file path)
w.files.upload_from(volume_file_path, upload_file_path, overwrite=True)

# Upload a file to a volume (method 2: recommended when your data is in-memory, or not a local file)
with open(upload_file_path, "rb") as f:
    w.files.upload(volume_file_path, io.BytesIO(f.read()), overwrite=True)

# List the contents of a volume.
for item in w.files.list_directory_contents(volume_path):
  print(item.path)

# List the contents of a folder in a volume.
for item in w.files.list_directory_contents(volume_folder_path):
  print(item.path)

# Download a file from a volume (method 1: recommended when data needs to be stored in a local file; fastest)
w.files.download_to(volume_file_path, local_download_path)

# Download a file from a volume (method 2: recommended when you need the data in-memory)
resp = w.files.download(volume_file_path)

chunk_size = 8192
with resp.contents as f:
    while True:
        chunk = f.read(chunk_size)
        if not chunk:
            break
        print(f"Read {len(chunk)} characters")

# Delete a file from a volume.
w.files.delete(volume_file_path)

# Delete a folder from a volume.
w.files.delete_directory(volume_folder_path)
```

### List account-level groups

This code example lists the display names for all of the available groups within the Databricks account.

> [!NOTE]
>
> Notebook-native authentication is not supported for `AccountClient`, so you must set credentials in the constructor to run this example in a notebook.

```python
from databricks.sdk import AccountClient

a = AccountClient()

for g in a.groups.list():
  print(g.display_name)
```

## Testing

To test your code, use Python test frameworks such as [pytest](https://docs.pytest.org/en/8.0.x/). To test your code under simulated conditions without calling Databricks REST API endpoints or changing the state of your Databricks accounts or workspaces, use Python mocking libraries such as [unittest.mock](https://docs.python.org/3/library/unittest.mock.html).

> [!TIP]
>
> [Databricks Labs](https://github.com/databrickslabs) provides a [pytest plugin](https://github.com/databrickslabs/pytester) to simplify integration testing with Databricks and a [pylint plugin](https://github.com/databrickslabs/pylint-plugin) to ensure code quality.

The following example file named `helpers.py` contains a `create_cluster` function that returns information about the new cluster:

```python
# helpers.py

from databricks.sdk import WorkspaceClient
from databricks.sdk.service.compute import ClusterDetails

def create_cluster(
  w: WorkspaceClient,
  cluster_name: str,
  spark_version: str,
  node_type_id: str,
  autotermination_minutes: int,
  num_workers: int
) -> ClusterDetails:
  response = w.clusters.create(
    cluster_name = cluster_name,
    spark_version = spark_version,
    node_type_id = node_type_id,
    autotermination_minutes = autotermination_minutes,
    num_workers = num_workers
  )
  return response
```

Given the following file named `main.py` that calls the `create_cluster` function:

```python
# main.py

from databricks.sdk import WorkspaceClient
from helpers import *

w = WorkspaceClient()

# Replace <spark-version> with the target Spark version string.
# Replace <node-type-id> with the target node type string.
response = create_cluster(
  w = w,
  cluster_name = 'Test Cluster',
  spark_version = '<spark-version>',
  node_type_id = '<node-type-id>',
  autotermination_minutes = 15,
  num_workers = 1
)

print(response.cluster_id)
```

The following file named `test_helpers.py` tests whether the `create_cluster` function returns the expected response. Rather than creating a cluster in the target workspace, this test mocks a `WorkspaceClient` object, defines the mocked object's settings, and then passes the mocked object to the `create_cluster` function. The test then checks whether the function returns the new mocked cluster's expected ID.

```python
# test_helpers.py

from databricks.sdk import WorkspaceClient
from helpers import *
from unittest.mock import create_autospec # Included with the Python standard library.

def test_create_cluster():
  # Create a mock WorkspaceClient.
  mock_workspace_client = create_autospec(WorkspaceClient)

  # Set the mock WorkspaceClient's clusters.create().cluster_id value.
  mock_workspace_client.clusters.create.return_value.cluster_id = '123abc'

  # Call the actual function but with the mock WorkspaceClient.
  # Replace <spark-version> with the target Spark version string.
  # Replace <node-type-id> with the target node type string.
  response = create_cluster(
    w = mock_workspace_client,
    cluster_name = 'Test Cluster',
    spark_version = '<spark-version>',
    node_type_id = '<node-type-id>',
    autotermination_minutes = 15,
    num_workers = 1
  )

  # Assert that the function returned the mocked cluster ID.
  assert response.cluster_id == '123abc'
```

To run this test, run the `pytest` command from the code project's root, which should produce test results similar to the following:

```bash
$ pytest
=================== test session starts ====================
platform darwin -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0
rootdir: <project-rootdir>
collected 1 item

test_helpers.py . [100%]
======================== 1 passed ==========================
```

## Troubleshooting

This section describes solutions to common issues with the Databricks SDK for Python.

To report issues or any other feedback, create a [GitHub issue for the Databricks SDK for Python](https://github.com/databricks/databricks-sdk-py/issues).

### Error: Unable to parse response

If you receive the following error when attempting to use the Databricks SDK for Python, it almost always indicates an issue with your authentication configuration.

```
Error: unable to parse response. This is likely a bug in the Databricks SDK for Python or the underlying REST API.
```

If you encounter this error, verify the following:

* Ensure your Databricks host is set correctly.
* Confirm that the authentication method has the required permissions for the API operation you are trying to perform.
* If you are behind a corporate firewall, ensure it is not blocking or redirecting API traffic.

A common cause of this error is private link redirecting the SDK to a login page, which the SDK cannot process. This usually happens when trying to access a private link-enabled workspace configured with no public internet access from a different network than the VPC endpoint belongs to.

For more details, see:

* [Databricks unified authentication](https://docs.databricks.com/aws/en/dev-tools/auth/unified-auth.md)

## Additional resources

For more information, see:

* Databricks SDK for Python [documentation](https://databricks-sdk-py.readthedocs.io)
* [Additional code examples](https://github.com/databricks/databricks-sdk-py/tree/main/examples)
* [Databricks Workspace APIs reference](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/index.html)
* [Databricks Account APIs reference](https://databricks-sdk-py.readthedocs.io/en/latest/account/index.html)
* [Logging](https://databricks-sdk-py.readthedocs.io/en/latest/logging.html)
* [Long-running operations](https://databricks-sdk-py.readthedocs.io/en/latest/wait.html)
* [Paginated responses](https://databricks-sdk-py.readthedocs.io/en/latest/pagination.html)

- [Single sign-on with OAuth](https://databricks-sdk-py.readthedocs.io/en/latest/oauth.html)
