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

discounts! #47

Merged
merged 11 commits into from
Jan 11, 2023
Merged

Conversation

fivetran-jamie
Copy link
Contributor

@fivetran-jamie fivetran-jamie commented Jan 10, 2023

Are you a current Fivetran customer?

fivetran made PR

What change(s) does this PR introduce?

adds discounts! to a new final model and aggregates them in shopify__orders

what i still need to do:

  • document this new model. I'll do this as the first review of this PR is happening (if that works for you joe)
  • incorporate the same logic for refunds and adjustments into the the staging discount_code model (ie create empty ones if the source tables don't exist) however, before i did this, i wanted to ask @fivetran-joemarkiewicz if we should should do this across the board in every tmp model...? 🤔

Did you update the CHANGELOG?

  • Yes
    no, will be done in the documentation PR

Does this PR introduce a breaking change?

  • Yes (please provide breaking change details below.)
  • No (please provide an explanation as to how the change is non-breaking below.)

Is this PR in response to a previously created Bug or Feature Request

  • Yes, Issue/Feature [link bug/feature number here]
  • No but came up on customer calls

How did you test the PR changes?

  • Buildkite
  • Local (please provide additional testing details below)

Select which warehouse(s) were used to test the PR

  • BigQuery
  • Redshift
  • Snowflake
  • Postgres
  • Databricks
  • Other (provide details below)

Provide an emoji that best describes your current mood

Feedback

We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your feedback on our existing dbt packages or what you'd like to see next.

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

@fivetran-jamie this is looking great! I have just a few comments, suggestions, and questions in my review below. Let me know if you have any questions.

Comment on lines +19 to +22
sum(order_discount_code.amount) as total_order_discount_amount,
sum(orders.total_line_items_price) as total_order_line_items_price,
sum(orders.shipping_cost) as total_order_shipping_cost,
sum(orders.refund_subtotal + orders.refund_total_tax) as total_order_refund_amount,
Copy link
Contributor

Choose a reason for hiding this comment

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

I could also see avg being a relevant metric when assessing discounts. Especially when it comes to percent values, I would be really interested to understand the average discount dollar amount. Who knows, maybe a 10% discount code is being used on large orders and is coming out to a super high average. I could see this being a useful metric.

What are your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah that's a good idea and will be very simple to add!

fivetran-jamie and others added 3 commits January 11, 2023 12:41
Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

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

Thanks for addressing these notes @fivetran-jamie!! All looks good on my end!

@fivetran-jamie fivetran-jamie merged commit 308a6e0 into feature/package-revamp Jan 11, 2023
@fivetran-jamie fivetran-jamie deleted the feature/revamp/discount-model branch January 11, 2023 23:07
@fivetran-jamie fivetran-jamie mentioned this pull request Jan 31, 2023
14 tasks
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