description |
---|
Integrate PipeRider with a dbt project in 5 mins |
This guide illustrates the usage of PipeRider with a dbt project by using dbt's Jaffle Shop project as an example.
Clone the jaffle_shop repository, set up a profile, and make sure that you have installed dbt and related packages.
git clone https://github.com/dbt-labs/jaffle_shop.git
cd jaffle_shop
To quickly set up a profile, we provide the following example that uses DuckDB.
Save the following content directly to a new file name profiles.yml
, and place it under the jaffle_shop directory.
# ./profiles.yml
jaffle_shop:
target: dev
outputs:
dev:
type: duckdb
path: jaffle_shop.duckdb
Install dbt-duckdb
.
pip install dbt-duckdb
Ensure the project builds without error.
dbt build
Install PipeRider with the DuckDB connector.
pip install 'piperider[duckdb]'
{% hint style="info" %} PipeRider requires Python 3.7+ {% endhint %}
Now that the dbt project is configured and PipeRider is installed, you can follow the normal practice of create a new branch to make your project changes on.
Create a new development branch to make changes to the project.
git checkout -b feature/add-average-value-per-order
Edit models/customers.sql
and add a new column to customers.
...
final as (
select
customers.customer_id,
customers.first_name,
customers.last_name,
customer_orders.first_order,
customer_orders.most_recent_order,
+ customer_payments.total_amount / customer_orders.number_of_orders as average_value_per_order,
customer_orders.number_of_orders,
customer_payments.total_amount as customer_lifetime_value
from customers
...
Run dbt command again to ensure that the changes have been applied correctly and the build completes without error.
dbt build
Using PipeRider's compare feature, you can now compare the state of you project before and and after making the recent model changes
Execute the following command to generate a comparison report for comparing the transformed models
piperider compare
PipeRider will output a comparison report link when the compssre process is finished. The report contains detailed data profiling statistics of your project before and after making the recent change.
{% hint style="info" %}
PipeRider focuses on analyzing the data impact of code changes introduced in pull requests. By default, piperider compare
employs a three-dot comparison method, which aligns with GitHub’s approach.
{% endhint %}
Please check the piperider run documentation for more information on running PipeRider and specifying resources.
- See the full tutorial of the Jaffle Shop
- Learn more about piperider run
- Learn more about piperider compare
- Try PipeRider Cloud