The Timeplus (Proton) plugin for dbt (data build tool)
Project description
dbt-timeplus
This plugin ports dbt functionality to Timeplus Proton.
Installation
Use your favorite Python package manager to install the app from PyPI, e.g.
pip install dbt-timeplus
Development
Follow the dbt Documentation to install dbt with pip.
python3.10 -m venv proton-dbt-env
source proton-dbt-env/bin/activate
# Installs matching versions for local dev/tests
pip install -r dev_requirements.txt
Then run pip install -e . to install the current dev code.
Testing:
pytest tests/unitruns fast unit tests (no DB needed).- Functional tests require a running Timeplus endpoint. Export env vars or use
tests/test.env:DBT_TEST_HOST(defaultlocalhost)DBT_TEST_PORT(default8463)DBT_TEST_USER(defaultdefault)DBT_TEST_PASSWORD(default empty)DBT_TEST_SCHEMA(defaultdefault)
- Run
pytest tests/functionalfor functional tests. - Run
pytest tests/integration/timeplus.dbtspecfor integration tests.
External sinks (Kafka / ClickHouse)
- If you run Kafka/ClickHouse locally (e.g., via Docker Compose), set the relevant environment variables for your setup, then run
pytest -k externalto execute only those tests. Seetests/test.env.samplefor the full variable list.
Note: host:port values depend on your environment and are not enforced by the adapter. Use the ports your services expose.
Typical defaults:
- ClickHouse native:
9000(plain),9440(TLS). HTTP:8123/8443. - Kafka brokers:
9092(plain), others depending on your deployment.
Tip: copy tests/test.env.sample to tests/test.env and edit for local runs (pytest-dotenv loads it automatically).
Compatibility
- Python: 3.10, 3.11, 3.12
- dbt-core: 1.10.x (pinned to
1.10.13) - proton-driver:
>=0.2.13
Supported features
- Table materialization
- View materialization
- Incremental materialization
- Seeds
- Sources
- Docs generate
- Tests
- Snapshots (experimental)
- Ephemeral materialization
Usage Notes
Database
The dbt model database.schema.table is not compatible with Timeplus because Timeplus does not support a schema.
So we use a simple model schema.table, where schema is the Timeplus database.
Bounded vs streaming queries
Timeplus streams are streaming by default. To avoid long-running queries in dbt models and tests, wrap streaming sources with table(...) when selecting, for example:
select window_end, cid, count() as cnt
from tumble(table(car_live_data), 1s)
group by window_end, cid
This produces a bounded snapshot for deterministic builds.
Model Configuration
| Option | Description | Default |
|---|---|---|
| engine | Stream engine used when creating streams | Stream(1, 1, rand()) |
| order_by | Column(s) or expression(s) used for ordering | to_start_of_hour(_tp_time) |
| partition_by | Partition expression for stream | to_YYYYMMDD(_tp_time) |
Example Profile
your_profile_name:
target: dev
outputs:
dev:
type: timeplus
schema: [database name] # default default
host: [db.url.timeplus] # default localhost
# optional
port: [port] # default 8463
user: [user]
password: [abc123]
cluster: [cluster name]
verify: [verify] # default False
secure: [secure] # default False
connect_timeout: [10] # default 10
send_receive_timeout: [300] # default 300
sync_request_timeout: [5] # default 5
compress_block_size: [1048576] # default 1048576
compression: ['lz4'] # default '' (disable)
Materialized views
Create a materialized view that writes into a target stream and optionally applies settings:
{{ config(materialized='materialized_view', into='mv_target', settings='checkpoint_interval=5') }}
select window_start as win_start, s, sum(i) as total
from tumble(table(rd), 2s)
group by window_start, s
External sinks (Kafka / ClickHouse)
The adapter includes tests/examples for Kafka and ClickHouse sinks. Export the environment variables shown above and run pytest -k external to execute only those tests.
Release and versioning
- Package name:
dbt-timeplus(renamed fromdbt-proton). - Adapter version mirrors dbt minor (
1.10.*). - The bundled macro package version in
dbt/include/timeplus/dbt_project.ymlis kept in sync as a convention.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbt_timeplus-1.10.0.tar.gz.
File metadata
- Download URL: dbt_timeplus-1.10.0.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc37e17751931d6ec888e95ba677522e2d46fad28dfd7cbd9a82b9986029712a
|
|
| MD5 |
777f8543e35b00b1e1fb99d3d1a80ac4
|
|
| BLAKE2b-256 |
2eba51dcb2bc8362cc3ec8d2ee32e1b2d96117cafd31e717002924e11f519025
|
Provenance
The following attestation bundles were made for dbt_timeplus-1.10.0.tar.gz:
Publisher:
publish.yml on timeplus-io/dbt-timeplus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbt_timeplus-1.10.0.tar.gz -
Subject digest:
fc37e17751931d6ec888e95ba677522e2d46fad28dfd7cbd9a82b9986029712a - Sigstore transparency entry: 627782752
- Sigstore integration time:
-
Permalink:
timeplus-io/dbt-timeplus@caeb2659ff57532a89d043d735c81e362f53ed57 -
Branch / Tag:
refs/tags/v1.10.1 - Owner: https://github.com/timeplus-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@caeb2659ff57532a89d043d735c81e362f53ed57 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbt_timeplus-1.10.0-py3-none-any.whl.
File metadata
- Download URL: dbt_timeplus-1.10.0-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
688160e603a29512eff762d5c81baace763024ed6f1d57a36bdb34081bc7e462
|
|
| MD5 |
1fcc1533eed18a0e96ab8f4bbcfa14fd
|
|
| BLAKE2b-256 |
9eccfb1867e1c24b4f2c89723e451b9100cd4c5e7b26466e13738e8edc97511b
|
Provenance
The following attestation bundles were made for dbt_timeplus-1.10.0-py3-none-any.whl:
Publisher:
publish.yml on timeplus-io/dbt-timeplus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbt_timeplus-1.10.0-py3-none-any.whl -
Subject digest:
688160e603a29512eff762d5c81baace763024ed6f1d57a36bdb34081bc7e462 - Sigstore transparency entry: 627782792
- Sigstore integration time:
-
Permalink:
timeplus-io/dbt-timeplus@caeb2659ff57532a89d043d735c81e362f53ed57 -
Branch / Tag:
refs/tags/v1.10.1 - Owner: https://github.com/timeplus-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@caeb2659ff57532a89d043d735c81e362f53ed57 -
Trigger Event:
push
-
Statement type: