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

Dbt cert josh #26

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Dbt cert josh #26

wants to merge 4 commits into from

Conversation

joshuadias2212
Copy link

No description provided.

Copy link

@evb123 evb123 left a comment

Choose a reason for hiding this comment

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

Some comments :)

jaffle_shop/models/final/sales/_models.yml Outdated Show resolved Hide resolved
jaffle_shop/models/warehouse/_models.yml Show resolved Hide resolved
@evb123
Copy link

evb123 commented Apr 11, 2024

Also small not on commits - they should start with a capitalised imperative verb. That means 'added' -> 'Add' ; 'updated' -> 'Update'

WITH returned_orders AS (
SELECT
orders.customer_id AS customer_id
orders.amount as total_amount
Copy link

Choose a reason for hiding this comment

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

I don't think this SQL would run - do you know why?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, missing comma, thanks

Copy link

@evb123 evb123 Apr 16, 2024

Choose a reason for hiding this comment

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

I think it won't run because you're referencing an alias (orders) without assigning it first. Also, FYI we use leading rather than trailing commas:

SELECT
customer_id
, SUM(COALESCE(total_amount, 0)) AS total_value
FROM returned_orders
GROUP BY customer_id

@@ -1,6 +1,6 @@
with customers as (

select * from {{ ref('stg_customers') }}
select * from {{ ref('stg_customers_pii') }}

),

Copy link

Choose a reason for hiding this comment

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

I've missed this in other PRs - SELECT * from cte's should generally not be used (only select columns that will be used ) + because this model uses PII, it should be renamed wh_customers_pii and put in the sensitive schema. No need to do this.

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I'll revert this change then to just select from stg_customers

@joshuadias2212 joshuadias2212 force-pushed the dbt_cert_josh branch 5 times, most recently from f1358e5 to f1c5198 Compare April 16, 2024 14:19
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.

2 participants