Skip to main content

dlt destination for loading data into Hotdata managed databases.

Project description

hotdata-dlt-destination

hotdata-dlt-destination is a Python package that implements a custom dlt destination for loading data into Hotdata managed databases with deterministic idempotency keys and explicit write semantics.

What this repo includes

  • Custom destination via @dlt.destination in src/hotdata_dlt_destination/destination.py
  • Managed-database ingestion through hotdata-runtime (upload_parquet, load_managed_table, SELECT)
  • Read-modify-write append/merge using only supported API operations
  • Deterministic batch and row idempotency keys
  • Example pipelines:
    • hotdata-dlt-basic-pipeline (append)
    • hotdata-dlt-incremental-pipeline (upsert/merge)
    • hotdata-dlt-linear-pipeline (Linear issues → Hotdata)
  • Unit tests in tests/
  • Architecture and runbook docs in docs/

Data contract defaults

  • Managed database: database_name (default dlt, created on first load when missing)
  • Schema: public
  • Table name: normalized lowercase dlt table identifier
  • Nested table names: {parent}__{child}
  • Write semantics (all use load_managed_table(replace) under the hood):
    • replace: upload batch parquet and replace the target table
    • append: read existing target rows, append batch in Python, replace target
    • upsert/merge: read existing rows, upsert by dlt primary_key (or _hotdata_row_key), replace target
  • Idempotency:
    • Batch key _hotdata_batch_key = hash(table + full batch payload)
    • Row key _hotdata_row_key = hash(table + canonical row payload)

Configure

Set environment variables (or pass destination kwargs / dlt secrets):

  • HOTDATA_API_KEY
  • HOTDATA_WORKSPACE
  • HOTDATA_DATABASE (managed database name, default dlt)
  • optional: HOTDATA_SCHEMA, HOTDATA_WRITE_DISPOSITION, HOTDATA_DECLARED_TABLES, retry tuning

For pipelines with multiple tables, declare every target table when the managed database is first created:

hotdata_destination(
    database_name="analytics",
    declared_tables=["customers", "orders", "orders__items"],
)

Usage

import dlt
from hotdata_dlt_destination import hotdata_destination

pipeline = dlt.pipeline(
    pipeline_name="my_pipeline",
    destination=hotdata_destination(
        database_name="analytics",
        write_disposition="append",
        declared_tables=["customers"],
    ),
)
pipeline.run(my_resource())

Per-resource write_disposition and primary_key from dlt take precedence over the destination default.

Developer workflow

uv sync
uv run ruff check .
uv run pytest
uv run hotdata-dlt-destination

Run pipelines:

uv run hotdata-dlt-basic-pipeline
uv run hotdata-dlt-incremental-pipeline
uv run hotdata-dlt-linear-pipeline

Run the live end-to-end integration test (requires Hotdata + Linear env vars):

uv run pytest tests/test_e2e_linear_hotdata.py -m integration

References

Project details


Download files

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

Source Distribution

hotdata_dlt_destination-0.3.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

hotdata_dlt_destination-0.3.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file hotdata_dlt_destination-0.3.0.tar.gz.

File metadata

  • Download URL: hotdata_dlt_destination-0.3.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hotdata_dlt_destination-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9df695a1282175b2d0f78eb2300e42d6f240526b2b0ca6ac408c8a734521ff87
MD5 50f490b9afcb87ed31c5286465fd4010
BLAKE2b-256 c579d373befe8d071904187aa689f69b8a1aa50713a1b8561b4780a852238574

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotdata_dlt_destination-0.3.0.tar.gz:

Publisher: publish.yml on hotdata-dev/hotdata-dlt-destination

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hotdata_dlt_destination-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hotdata_dlt_destination-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 956a9bd760c6bf3151d967daccd4935f1943ac3ef49f8074ede4fde5f3b7bfdb
MD5 b0e667c4edddab9c8ad53d44d361efb3
BLAKE2b-256 f3f8acecd181ac9ce0b6627500ba1c0af006869f062ffa12703b1485e47397a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hotdata_dlt_destination-0.3.0-py3-none-any.whl:

Publisher: publish.yml on hotdata-dev/hotdata-dlt-destination

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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