Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fanout in customers model #20

Merged
merged 15 commits into from
Mar 29, 2024
Merged

Fix fanout in customers model #20

merged 15 commits into from
Mar 29, 2024

Conversation

gwenwindflower
Copy link
Contributor

@gwenwindflower gwenwindflower commented Mar 28, 2024

Closes #1

This turned into pulling a sweater thread that unravelled some issues in the source data, so I had to dig in to quite a bit!

Taskfile.yml Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect Cloud CLI to be installed by brew so no venv activation needed for these

dbt_project.yml Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version sqlfluff installs by default in the pre-commit hook environment via sqlfluff-dbt-templater so we need to allow for it, although I anticipated primarily dbt Cloud CLI with versionless as the prime target for this project

@@ -6,7 +6,7 @@ orders as (

),

order_items_table as (
order_items as (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we no longer need to do this renaming as this was for a DuckDB issue

@@ -1,6 +1,9 @@
models:
- name: customers
description: Customer overview data mart, offering key details for each unique customer. One row per customer.
tests:
- dbt_utils.expression_is_true:
expression: "lifetime_spend_pretax + lifetime_tax_paid = lifetime_spend"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the core thing this PR exists to make true

Copy link
Contributor

@dave-connors-3 dave-connors-3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦞

@gwenwindflower gwenwindflower merged commit 2447e1b into main Mar 29, 2024
6 checks passed
@gwenwindflower gwenwindflower deleted the fix/fanout-in-customers branch March 29, 2024 18:17
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customers mart has a fan-out when an order contains multiple items
2 participants