dbt artifacts
The Elementary dbt package includes uploading and modeling of dbt artifacts.
How Elementary uploads dbt artifacts?
The Elementary dbt package includes macros that extract specific fields from the artifacts during the execution, and insert to tables. These tables are defined as models of the package.
Some artifacts are updated by an on-run-end hook when you run dbt run / test / build
, and some only when you run the models:
- On run end:
elementary_test_results
- Results of all dbt tests (including elementary and other packages, such as dbt_expectations and dbt_utils).dbt_run_results
- Results of all dbt executions.
dbt run
that includes elementary models:dbt_models
,dbt_tests
,dbt_sources
,dbt_exposures
,dbt_metrics
- Metadata and configuration. It is recommended to run these models when you make changes in your projects.
Which artifacts are uploaded and modeled?
Elementary uploads fields from the run-results, and the graph object (includes data of manifest, catalog and sources).
You can disable or enable the relevant models in the Elementary package if you want to limit the artifacts that are loaded to your data warehouse (under elementary/models/edr/dbt_artifacts
).
dbt artifacts models
Elementary loads data from dbt artifacts to models that can be found under dbt_artifacts
folder of the package.
For dbt_run_results
data is inserted at the on-run-end, and for the rest of the models it’s a post-hook on the model itself.
The dbt artifacts models are:
dbt_run_results
Run results of models and tests, inserted at the end of each invocation. Each row is the invocation result of a single resource (model, test, etc.), and includes information like execution time start and end, status and affected rows. This is an incremental model, new run results are added with each invocation that produces a result object.
dbt_models
Data about all the models in the project and project packages. Each row contains information about the properties of a single model, including columns like tags, owner, materialization, depends_on, and description. Each time the model is executed, the data is replaced with data from the project’s current graph.
dbt_tests
Data about all the tests in the project and project packages. Each row contains information about the properties of a single test, including columns like severity, parent model unique id, tags and owner of the parent model, test params, and the test compiled query. Each time the model is executed, the data is replaced with data from the project’s current graph.
dbt_sources
Data about the sources configured in the project and project packages. Each row contains information about the properties of a single source, including columns like tags, owner, freshness configuration, database and schema. Each time the model is executed, the data is replaced with data from the project’s current graph.
dbt_exposures
Data about the exposures configured in the project and project packages. Each row contains information about the properties of a single exposure, including columns like tags, owner, url and depends on. Each time the model is executed, the data is replaced with data from the project’s current graph.
dbt_metrics
Data about the metrics configured in the project and project packages. Each row contains information about the properties of a single metric, including columns like tags, owner, sql, and depends on. Each time the model is executed, the data is replaced with data from the project’s current graph.
dbt_snapshots
Data about all the snapshots in the project and project packages. Each row contains information about the properties of a single snapshot, including columns like tags, owner, depends_on, and description. Each time the model is executed, the data is replaced with data from the project’s current graph.
dbt_columns
Data about all the columns that are documented in the yml files. Each row contains information about the properties of a single column, including data type and description. Each time the model is executed, the data is replaced with data from the project’s current graph.