dbt Write-Back allows you to develop your models and Metrics in Lightdash and write back these changes to your dbt project. Writing back to dbt will create a new branch and pull request in your project so you can save and manage these changes.
Developer
to use dbt Write-Back.
Write back to dbt
.
Refresh dbt
in Lightdash (or, if you’re using GitHub actions, your project will automatically refresh once your changes are merged) and your Custom Metric will be replaced by your new YAML Metric automatically.
Write back to dbt
.
Write back to dbt
Refresh dbt
in Lightdash (or, if you’re using GitHub actions, your project will automatically refresh once your changes are merged).
Write back to dbt
option from the Save
drop-down.
Open pull request
will open a pull request created by Lightdash against your dbt project in GitHub.
models/lightdash/
directory. The model will have the tag created-by-lightdash
included in the model config.
Table
in LightdashShow entire project
then you don’t need to do anything. The models should appear automatically if you refresh your dbt project connection.
Show models with any of these tags
, you’ll need to add created-by-lightdash
to the list of accepted tags. By default, models that you write back to dbt will have the tag created-by-lightdash
included in the model config.
Show models in this list
, you’ll need to manually add the new models to the list of accepted models here.
Error: not found your_table_name
, it’s likely because you haven’t built the table generated by your new model in your data warehouse yet. There are a couple of ways to handle this:
dbt run -s your_model_name_here
to create the table in your data warehouse. You might need to add --target prod
if your default profile is set to dev
!
created-by-lightdash
.
To create a job that does this, you’ll want to:
Deploy
—> Jobs
and click create new job
triggered by pull requests
in the Git Trigger
section
dbt run --select tag:created-by-lightdash
compare changes against environment
to prod
. This will make sure that this job only runs when a model is changed from your pull request