Skip to main content

tentaclio-databricks

A package containing all the dependencies for the databricks+thrift tentaclio schema .

Quick Start

This project comes with a Makefile which is ready to do basic common tasks

$ make help
install                       Initalise the virtual env installing deps
clean                         Remove all the unwanted clutter
lock                          Lock dependencies
update                        Update dependencies (whole tree)
sync                          Install dependencies as per the lock file
lint                          Lint files with flake and mypy
format                        Run black and isort
test                          Run unit tests
circleci                      Validate circleci configuration (needs circleci cli)

Configuring access to Databricks

Your connection url should be in the following format:

databricks+thrift://<token>@<host>?HTTPPath=<http_path>

Example values:

  • token: dapi1213456789abc
  • host: myhost.databricks.com
  • http_path: /sql/1.0/endpoints/123456789

Query Comments

Queries can be annotated with comments for observability using the query_annotations parameter.

Example: Basic usage

import os
from tentaclio import URL
from tentaclio_databricks.clients.databricks_client import DatabricksClient

url = URL("databricks+thrift://token@host.databricks.com?HTTPPath=/sql/1.0/endpoints/123")
client = DatabricksClient(
    url,
    query_annotations={
        "app_name": "JupyterHub",
        "user": os.environ.get("USER_NAME", "unknown"),
        "pipeline_id": "456"
    }
)

Result

All queries executed by the client will have prepended comments:

/* app_name='JupyterHub', user='john', pipeline_id='456' */
SELECT * FROM table

Arrow Usage

DatabricksClient enables Arrow's usage for faster data transfer and more faithful type handling.

Example: Default row-based fetch

from tentaclio import URL
from tentaclio_databricks.clients.databricks_client import DatabricksClient

url = URL("databricks+thrift://token@host.databricks.com?HTTPPath=/sql/1.0/endpoints/123")
with DatabricksClient(url) as client:
    df = client.get_df("SELECT * FROM sample_table")

When Arrow is disabled, the client falls back to fetchall() and uses arraysize for the cursor.

Example: Arrow enabled

from tentaclio import URL
from tentaclio_databricks.clients.databricks_client import DatabricksClient

url = URL("databricks+thrift://token@host.databricks.com?HTTPPath=/sql/1.0/endpoints/123")
with DatabricksClient(url, use_arrow=True) as client:
    df = client.get_df("SELECT * FROM sample_table")

When Arrow is enabled, the client configures the connection with:

  • use_arrow_native_complex_types
  • use_arrow_native_decimals
  • use_arrow_native_timestamps

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tentaclio_databricks-2.1.0.tar.gz (144.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tentaclio_databricks-2.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file tentaclio_databricks-2.1.0.tar.gz.

File metadata

  • Download URL: tentaclio_databricks-2.1.0.tar.gz
  • Upload date:
  • Size: 144.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tentaclio_databricks-2.1.0.tar.gz
Algorithm Hash digest
SHA256 e1f0e858214b2cf84d9f7c83f60bc7d9882f6266974beb5f4d4ee38fcea7bf0d
MD5 0f53910a47a0e15ace4864d0912a28cc
BLAKE2b-256 44fef09290848a067fbe23b03f0a0015ba5fe343cf07392cedaec4a66b609e28

See more details on using hashes here.

File details

Details for the file tentaclio_databricks-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: tentaclio_databricks-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tentaclio_databricks-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b396249e0dca7bea05ee4d3cc81b2d83a7ccd31e2d604823972c205a7edcf5da
MD5 6ec80c09d2b96e8d7cde45fa99191017
BLAKE2b-256 601310db92356b8802438011d33300ade4884f8ac5a241fab1d1c9efda1121f1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.1

2 files

0.0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page