Skip to content

[Demo] Understand if a customer has promoted orders #44

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

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

Conversation

popcornylu
Copy link

@popcornylu popcornylu commented Feb 4, 2025

In this PR, we want to understand if a customer has ever had an promotion order.

  1. I add a is_promotion in the stg_payment model, it is true if the method is coupon
  2. The customer model would check if there are any order with payment is_promotion = true

We can see the stg_payment is a non-breaking change, it would not affect the downstream models (e.g. orders)

image

@popcornylu popcornylu changed the base branch from duckdb to main February 4, 2025 06:37
@popcornylu popcornylu changed the title Understand if a customer has promoted orders [Demo] Understand if a customer has promoted orders Feb 5, 2025
@popcornylu popcornylu force-pushed the feature/add-payment-promotion-column branch 2 times, most recently from 6a39f5e to 1967696 Compare February 11, 2025 05:53
Copy link

github-actions bot commented Feb 11, 2025

Recce Summary

Manifest Information

Manifest Catalog
Base 2025-03-30 00:20:06 2025-03-30 00:20:07
Current 2025-04-03 17:22:03 2025-04-03 17:22:03

Lineage Graph

graph LR
model.jaffle_shop.customers["customers

[What's Changed]
Code, Schema"]
style model.jaffle_shop.customers stroke:#ffa502
model.jaffle_shop.customers---->model.jaffle_shop.customer_order_pattern
model.jaffle_shop.customers---->model.jaffle_shop.customer_segments
model.jaffle_shop.stg_payments["stg_payments

[What's Changed]
Code, Schema"]
style model.jaffle_shop.stg_payments stroke:#ffa502
model.jaffle_shop.stg_payments---->model.jaffle_shop.orders
model.jaffle_shop.stg_payments---->model.jaffle_shop.customers
model.jaffle_shop.customer_order_pattern["customer_order_pattern"]
model.jaffle_shop.customer_segments["customer_segments"]
model.jaffle_shop.orders["orders

[What's Changed]
"]

Loading

Checks Summary

Checks Run Data Mismatch Detected
4 1

Checks of Data Mismatch Detected

Name Type Mismatched Nodes
Model schema of customers, orders and modified nodes Schema Diff stg_payments, customers

See PR page: https://cloud.datarecce.io/DataRecce/jaffle_shop_duckdb/pulls/44

How to check the recce result

# Launch the recce server based on the state file
recce server --review --cloud --password yummy_jaffle

# Open the recce server http://localhost:8000 by your browser

@wcchang1115 wcchang1115 force-pushed the feature/add-payment-promotion-column branch from 1967696 to 95ea88c Compare February 20, 2025 03:45
@ijac13
Copy link

ijac13 commented Mar 25, 2025

The where condition at customers.sql line 68 should be removed.

Reasons

  1. Adding has_promoted_orders in customers model should not impact to row counts.
    Mar 18 Screenshot from SQL Issue

  2. The impact is due to the where condition that restrict the customers.sql only have customers who has_promoted_orders = true
    Mar 18 Screenshot from SQL Issue (1)

@ijac13 ijac13 closed this Apr 3, 2025
@ijac13 ijac13 deleted the feature/add-payment-promotion-column branch April 3, 2025 05:01
@wcchang1115 wcchang1115 restored the feature/add-payment-promotion-column branch April 3, 2025 17:19
@wcchang1115 wcchang1115 reopened this Apr 3, 2025
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.

3 participants