Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 28, 2025
1 parent c07b5c3 commit 9d6f1c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ models:
description: int, foreign key referencing ecommerce_coupon. This will be null
for records sourced from b2b.
- name: redeemed
description: boolean, set to true if the coupon has at least one redeemed order
description: boolean, set to true if the coupon has at least one redeemed order
otherwise it's false.
tests:
- dbt_expectations.expect_compound_columns_to_be_unique:
Expand Down
12 changes: 6 additions & 6 deletions src/ol_dbt/models/marts/mitxpro/marts__mitxpro_all_coupons.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ select
, allcoupons.coupon_source_table
, allcoupons.b2bcoupon_id
, allcoupons.coupon_id
, case
, case
when
redeemed_coupons.coupon_id is not null
or redeemed_coupons.b2bcoupon_id is not null
redeemed_coupons.coupon_id is not null
or redeemed_coupons.b2bcoupon_id is not null
then true
when
redeemed_coupons.coupon_id is null
redeemed_coupons.coupon_id is null
and redeemed_coupons.b2bcoupon_id is null
then false
then false
end as redeemed
from allcoupons
left join redeemed_coupons
on
on
allcoupons.coupon_id = redeemed_coupons.coupon_id
or allcoupons.b2bcoupon_id = redeemed_coupons.b2bcoupon_id

0 comments on commit 9d6f1c2

Please sign in to comment.