databricks-sql-connector 4.1.4


pip install databricks-sql-connector

  Latest version

Released: Oct 15, 2025


Meta
Author: Databricks
Requires Python: >=3.8.0,<4.0.0

Classifiers

License
  • OSI Approved :: Apache Software License

Programming Language
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Databricks SQL Connector for Python

PyPI Downloads

The Databricks SQL Connector for Python allows you to develop Python applications that connect to Databricks clusters and SQL warehouses. It is a Thrift-based client with no dependencies on ODBC or JDBC. It conforms to the Python DB API 2.0 specification.

This connector uses Arrow as the data-exchange format, and supports APIs (e.g. fetchmany_arrow) to directly fetch Arrow tables. Arrow tables are wrapped in the ArrowQueue class to provide a natural API to get several rows at a time. PyArrow is required to enable this and use these APIs, you can install it via pip install pyarrow or pip install databricks-sql-connector[pyarrow].

The connector includes built-in support for HTTP/HTTPS proxy servers with multiple authentication methods including basic authentication and Kerberos/Negotiate authentication. See docs/proxy.md and examples/proxy_authentication.py for details.

You are welcome to file an issue here for general use cases. You can also contact Databricks Support here.

Requirements

Python 3.8 or above is required.

Documentation

For the latest documentation, see

Quickstart

Installing the core library

Install using pip install databricks-sql-connector

Installing the core library with PyArrow

Install using pip install databricks-sql-connector[pyarrow]

export DATABRICKS_HOST=********.databricks.com
export DATABRICKS_HTTP_PATH=/sql/1.0/endpoints/****************

Example usage:

import os
from databricks import sql

host = os.getenv("DATABRICKS_HOST")
http_path = os.getenv("DATABRICKS_HTTP_PATH")

connection = sql.connect(
  server_hostname=host,
  http_path=http_path)

cursor = connection.cursor()
cursor.execute('SELECT :param `p`, * FROM RANGE(10)', {"param": "foo"})
result = cursor.fetchall()
for row in result:
  print(row)

cursor.close()
connection.close()

In the above example:

  • server-hostname is the Databricks instance host name.
  • http-path is the HTTP Path either to a Databricks SQL endpoint (e.g. /sql/1.0/endpoints/1234567890abcdef), or to a Databricks Runtime interactive cluster (e.g. /sql/protocolv1/o/1234567890123456/1234-123456-slid123)

Note: This example uses Databricks OAuth U2M to authenticate the target Databricks user account and needs to open the browser for authentication. So it can only run on the user's machine.

SQLAlchemy

Starting from databricks-sql-connector version 4.0.0 SQLAlchemy support has been extracted to a new library databricks-sqlalchemy.

Quick SQLAlchemy guide

Users can now choose between using the SQLAlchemy v1 or SQLAlchemy v2 dialects with the connector core

  • Install the latest SQLAlchemy v1 using pip install databricks-sqlalchemy~=1.0
  • Install SQLAlchemy v2 using pip install databricks-sqlalchemy

Contributing

See CONTRIBUTING.md

License

Apache License 2.0

4.1.4 Oct 15, 2025
4.1.3 Sep 17, 2025
4.1.2 Aug 22, 2025
4.1.1 Aug 21, 2025
4.1.0 Aug 18, 2025
4.0.6 Aug 18, 2025
4.0.5 Jun 26, 2025
4.0.4 Jun 16, 2025
4.0.3 Apr 22, 2025
4.0.2 Apr 01, 2025
4.0.1 Mar 19, 2025
4.0.0 Jan 22, 2025
4.0.0b4 Nov 13, 2024
4.0.0b3 Nov 06, 2024
4.0.0b2 Nov 05, 2024
4.0.0b1 Oct 14, 2024
4.0.0b0 Oct 08, 2024
3.7.4 Apr 22, 2025
3.7.3 Feb 28, 2025
3.7.2 Feb 03, 2025
3.7.1 Jan 07, 2025
3.7.0 Dec 23, 2024
3.6.0 Oct 25, 2024
3.5.0 Oct 18, 2024
3.4.0 Aug 27, 2024
3.3.0 Jul 17, 2024
3.2.0 Jun 14, 2024
3.1.2 Apr 18, 2024
3.1.1 Mar 19, 2024
3.1.0 Feb 17, 2024
3.0.3 Feb 02, 2024
3.0.3b1 Jan 29, 2024
3.0.2 Jan 26, 2024
3.0.1 Dec 01, 2023
3.0.0 Nov 17, 2023
3.0.0b1 Nov 01, 2023
2.9.6 Apr 18, 2024
2.9.5 Mar 19, 2024
2.9.4 Feb 21, 2024
2.9.4b1 Feb 16, 2024
2.9.3 Aug 24, 2023
2.9.2 Aug 18, 2023
2.9.2.dev1 Aug 15, 2023
2.9.1 Aug 11, 2023
2.9.1.dev1 Aug 11, 2023
2.9.0 Aug 10, 2023
2.8.0 Jul 21, 2023
2.7.1.dev3 Jul 12, 2023
2.7.1.dev2 Jul 12, 2023
2.7.1.dev1 Jul 10, 2023
2.7.0 Jun 26, 2023
2.6.3.dev1 Jun 21, 2023
2.6.2 Jun 14, 2023
2.6.1 Jun 08, 2023
2.6.1.dev1 Jun 08, 2023
2.6.0 Jun 07, 2023
2.5.2 May 09, 2023
2.5.1 Apr 28, 2023
2.5.0 Apr 15, 2023
2.4.1 Mar 21, 2023
2.4.0 Feb 21, 2023
2.3.1.dev1 Jan 12, 2023
2.3.0 Jan 10, 2023
2.2.2 Jan 03, 2023
2.2.1 Nov 28, 2022
2.2.0 Nov 17, 2022
2.2.dev1676479629 Feb 15, 2023
2.2.dev1675985183 Feb 09, 2023
2.2.dev1669954165 Dec 02, 2022
2.1.0 Oct 01, 2022
2.1.dev1672379067 Dec 30, 2022
2.1.dev1666624638 Oct 26, 2022
2.0.5 Aug 23, 2022
2.0.4 Aug 17, 2022
2.0.3 Aug 10, 2022
2.0.2 May 05, 2022
2.0.1 Apr 22, 2022
2.0.0 Apr 20, 2022
2.0.0b2 Apr 11, 2022
2.0.0b1 Mar 07, 2022
2.0.0b0 Feb 24, 2022
1.0.2 Apr 07, 2022
1.0.1 Feb 02, 2022
1.0.0 Jan 25, 2022
0.9.4 Jan 11, 2022
0.9.3 Dec 08, 2021
0.9.2 Dec 02, 2021
0.9.1 Sep 02, 2021
0.9.0 Aug 05, 2021
Extras:
Dependencies:
lz4 (<5.0.0,>=4.0.2)
oauthlib (<4.0.0,>=3.1.0)
openpyxl (<4.0.0,>=3.0.10)
pandas and (<2.3.0,>=1.2.5)
pandas (<2.3.0,>=2.2.3)
pyjwt (<3.0.0,>=2.0.0)
python-dateutil (<3.0.0,>=2.8.0)
requests (<3.0.0,>=2.18.1)
thrift (<0.21.0,>=0.16.0)
urllib3 (>=1.26)