The dbt converter is a CLI tool that simplifies the process of migrating from the metrics spec supported in dbt v1.5 and earlier to the metrics specification supported in dbt ≥v1.6.
Installing dbt converter
pip install dbt-metrics-converter
Upgrading to dbt v1.6 spec
- Navigate to the root of your dbt project.
pip install dbt-metrics-converter. Note that the converter requires dbt-core==1.5. You may need to update the version range for the dbt_metrics package.- Run
dbtc convert-metrics. The converter assumes you are in the root of your dbt project. Optionally, you can pass the project path-dbt-project-path path/to/dbt_project. NOTE: All metrics must have a timestamp for the upgrade to run. If your metrics do not have a timestamp, add one before running the converter. - Semantic models and metrics files will be created in the
semantic_modelsandmetricsdirectories. Move these folders into your model path. - Delete the
metricspackage, move the old metrics configs out of your model path, or delete them.
Testing your metrics in dbt v1.6
- Upgrade to dbt v1.6, and
pip install dbt-metricflow - Remove the old metrics package from your
dbt_packagesand rundbt clean && dbt deps. - Run
dbt parseto generate a semantic manifest - View the metrics in your dbt project by running
mf list metrics - Run
mf validate-configs —skip-dwto validate metrics configs. - To run a test query, run
mf query --metrics <metric_name>
Gotchas:
- Some packages, like fivetran/ad_reporting have metrics defined in them using the v1.5 spec, this may cause an error if you try to run your project after upgrading to v1.6
- Make sure to delete any calls of
metrics.calculateormetrics.developthey won’t work without the dbt_metrics package
Metadata
Release files for dbt-metrics-converter 0.1.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dbt_metrics_converter-0.1.5.3.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dbt_metrics_converter-0.1.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.5 kB
Release files / dbt_metrics_converter-0.1.5.3.tar.gz
| Download URL | dbt_metrics_converter-0.1.5.3.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca0b5f8578f9d99e60b536252137632c30a6b0f614f0b7a8dbf7fcf088d9aa3f
|
|
BLAKE2b-256 checksum How to use checksums |
113640ff94e8421a28afa1aa7dfb380f2f6c6766960731b5e197b215aa0906f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.16 Darwin/22.5.0
|
Release files / dbt_metrics_converter-0.1.5.3-py3-none-any.whl
| Download URL | dbt_metrics_converter-0.1.5.3-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d6f60fb82ea2c27bc4a81d217f268d52fd6060f925c5b9c6cce7dc7546233ac
|
|
BLAKE2b-256 checksum How to use checksums |
1295a3af22fd4ff74a02a707d4f1944e8a2a29de6b78c685471c46e5e6675c94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.16 Darwin/22.5.0
|