Databricks (Legacy CLI Library)
This is an outdated Python library for interacting with Databricks, primarily as a command-line interface. Its last release was in 2017 (version 0.2), and it has been superseded by the `databricks-cli` and more recently the `databricks-sdk` for programmatic API access. Users seeking modern Databricks integration should use the `databricks-sdk` or `databricks-sql-connector` libraries.
Warnings
- breaking This `databricks` package (version 0.2, last updated 2017) is obsolete and considered abandoned. It is not compatible with modern Databricks APIs or best practices. Attempting to use it will likely result in functional failures, authentication issues, or compatibility problems.
- deprecated The `databricks` package has been deprecated and superseded by `databricks-sdk` (for API operations) and `databricks-cli` (for command-line interfaces). The Python 3.7 support for `databricks-sdk` was dropped in June 2023, requiring Python 3.8+ for modern SDKs.
- gotcha The authentication mechanisms used by this old library (v0.2) are likely incompatible with current Databricks authentication methods (e.g., Databricks personal access tokens, OAuth). Modern SDKs implement a robust default authentication flow.
- gotcha Databricks Runtime environments (especially 13.3 LTS and above) come with the `databricks-sdk` pre-installed. Using `%pip install --upgrade databricks-sdk` is recommended in Databricks notebooks to ensure the latest version.
Install
-
pip install databricks==0.2
Quickstart
# This package (databricks==0.2) is a very old command-line utility.
# Direct programmatic Python usage is not well documented or supported.
#
# For modern Databricks API interactions, use databricks-sdk:
# from databricks.sdk import WorkspaceClient
# w = WorkspaceClient()
# for c in w.clusters.list():
# print(c.cluster_name)
#
# For Databricks SQL connectivity, use databricks-sql-connector:
# from databricks.sql import connect
# with connect(server_hostname=os.environ.get('DATABRICKS_SERVER_HOSTNAME'),
# http_path=os.environ.get('DATABRICKS_HTTP_PATH'),
# access_token=os.environ.get('DATABRICKS_TOKEN')) as connection:
# with connection.cursor() as cursor:
# cursor.execute('SELECT 1')
# print(cursor.fetchall())