Registry / database / databricks-dbapi

databricks-dbapi

JSON →
library0.6.0pypypiunverified

A DBAPI 2.0 interface and SQLAlchemy dialect for Databricks interactive clusters. Current version 0.6.0, supports Python >=2.7 (excludes 3.0-3.4). Release cadence is irregular; latest releases: 0.4.0, 0.5.0, 0.6.0.

pip install databricks-dbapi
INSTALL
IMPORT
SIG · DATABRICKS-DBAPI
D
databricks-dbapi
databasepythonv0.6.0
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Connection
✓ from databricks_dbapi import Connection
✗ from databricks_dbapi import Connection

Connect to Databricks interactive cluster using HTTP (default) with personal access token.

from databricks_dbapi import Connection conn = Connection( server_hostname='your-databricks-instance.cloud.databricks.com', http_path='/sql/1.0/warehouses/your-warehouse-id', access_token=os.environ.get('DATABRICKS_TOKEN', '') ) cursor = conn.cursor() cursor.execute('SELECT current_timestamp') print(cursor.fetchall())
Debug
Known issues
breakingVersion 0.5.0 removed support for Python 3.5 and earlier; ensure Python 3.6+.
fix
Use Python 3.6+ or pin to databricks-dbapi==0.4.0.
affects: >=0.5.0
gotchaThe default connection uses HTTP (REST API), but if you need HiveServer2 Thrift, you must explicitly specify transport='thrift'.
fix
Connection(..., transport='thrift')
affects: all
deprecatedThe SQLAlchemy dialect uses 'databricks+http://' or 'databricks+thrift://'; the plain 'databricks://' prefix may be removed in future.
fix
Use 'databricks+http://' or 'databricks+thrift://' explicitly.
affects: all
gotchaTimeout errors often occur if server_hostname or http_path are incorrect; they are not validated until a query is run.
fix
Double-check server_hostname (e.g., 'dbc-...cloud.databricks.com') and http_path (from SQL Warehouse settings).
affects: all
Upgrade
Version history
0.6.0latest on PyPI · released Nov 22, 2021
Audit
Dependencies
thriftoptionalRequired for Thrift-based HiveServer2 connection
requestsoptionalRequired for HTTP-based connection
sqlalchemyoptionalRequired for SQLAlchemy dialect support
Agent activity
21 hits · last 30 days
node
20
Bingbot
1
Resources
databricks-dbapi — pip install databricks-dbapi · libregistry