Skip to content

Instantly share code, notes, and snippets.

@popcornylu
Last active July 18, 2023 08:05
Show Gist options
  • Save popcornylu/7a9f68c1ea80f09ba9c780d2026ce71e to your computer and use it in GitHub Desktop.
Save popcornylu/7a9f68c1ea80f09ba9c780d2026ce71e to your computer and use it in GitHub Desktop.
sc-31723: Comparison summary

Definition

  1. Explicit Changes
    • added = new added resources
    • removed = removed resources
    • modified = code change
  2. Impacted = explict changes and their downstream
  3. Implict Changes = any detected changes which are not explict changed (e.g schema change, profiling stat change, metric query result)

Considerations

  1. There are 64K characters limit in a PR comment.
  2. The icon image is lenghty, so we put it in the header
  3. The hover tip is lenghthy, so we remove them
  4. We only list 50 resources for each type of resources
  5. We should list the models by topology sorting
  6. We should detect dbt execution time with significant change as implicit change. (e.g. >1s and 20%+ change)

The new added output is mark as +

$ piperider compare
...
 [  OK  ]   orders.customer_id                                not_null_orders_customer_id
 [  OK  ]   orders.gift_card_amount                           not_null_orders_gift_card_amount
 [  OK  ]   orders.order_id                                   not_null_orders_order_id
 [  OK  ]   orders.order_id                                   unique_orders_order_id


Generating reports from: /Users/popcorny/Documents/infuseai/repo/jaffle_shop/.piperider/outputs/dev-20230629113339/run.json
Report generated in: /Users/popcorny/Documents/infuseai/repo/jaffle_shop/.piperider/outputs/dev-20230629113339/index.html

Switch git branch back to: [main]
─────────────── Comparison report ────────────────────
Selected reports:
  Base:   /Users/popcorny/Documents/infuseai/repo/jaffle_shop/.piperider/outputs/dev-20230628151228/run.json
  Target: /Users/popcorny/Documents/infuseai/repo/jaffle_shop/.piperider/outputs/dev-20230628151237/run.json

+Statistics:
+  Models: total=320, explict=5(added=2, removed=0, modified=3), impacted=134, implicit=4
+  Metrics: total=5, explict=1(added=0, removed=0, modified=1), impacted=5, implicit=1

Comparison report: /Users/popcorny/Documents/infuseai/repo/jaffle_shop/.piperider/comparisons/latest/index.html
Comparison summary: /Users/popcorny/Documents/infuseai/repo/jaffle_shop/.piperider/comparisons/latest/summary.md
Comparison report URL: http://localhost:3000/workspace-c4bd/default/runs/b3766f2b4695481a8d3c47110eb60eff/comparison/8cf0ad7e9078453f82ddf0b4d5e4c5a2  

Comparison Summary

PiperRider Report

Resource Total Explicit Changes Impacted Implicit Changes
Models 320 5 ( 2 0 3) 134 4
Metrics 5 1 ( 0 0 1) 5 1

Models

Model Columns
Rows Dbt Time Failed Tests All Tests
models/marts/neworders.sql 14 3256 $\color{orange}{\text{}}$ 0:00:00.16 $\color{red}{\text{ (↑ 0.02) }}$ 0 8 $\color{green}{\text{ (↑ 1) }}$
models/marts/orders.sql 16 ($\color{green}{\text{ 1 }}$ / $\color{red}{\text{ 1 }}$ / $\color{orange}{\text{ 5 }}$) 97 $\color{red}{\text{ (↓ -2) }}$ 0:00:00.16 $\color{red}{\text{ (↑ 0.02) }}$ 3 $\color{red}{\text{ (↑ 3)}}$ 8
models/marts/orders.sql 10 ($\color{green}{\text{ 0 }}$ / $\color{red}{\text{ 1 }}$ / $\color{orange}{\text{ 0 }}$) 997 $\color{green}{\text{ (↑ 20) }}$ 0:00:00.16 $\color{green}{\text{ (↓ 0.05) }}$ 0 5 $\color{red}{\text{ (↓ 1) }}$
models/marts/oldorders.sql 13 100
models/marts/orders5.sql 10 ($\color{green}{\text{ 0 }}$ / $\color{red}{\text{ 1 }}$ / $\color{orange}{\text{ 0 }}$) - 0:00:00.16 $\color{red}{\text{ (↑ 0.02) }}$ - -
models/marts/orders6.sql 10 ($\color{green}{\text{ 0 }}$ / $\color{red}{\text{ 1 }}$ / $\color{orange}{\text{ 0 }}$) - 0:00:00.16 $\color{red}{\text{ (↑ 0.02) }}$ 0 $\color{green}{\text{ (↓ 2)}}$ 8
.../super/long/orders7.sql 10 ($\color{green}{\text{ 0 }}$ / $\color{red}{\text{ 1 }}$ / $\color{orange}{\text{ 0 }}$) 997 $\color{green}{\text{ (↑ 20) }}$ 0:00:00.16 $\color{red}{\text{ (↑ 0.02) }}$ 0 8
410 more changed models..

Metrics

Metric Queries
total ($\color{orange}{\text{ changed }}$ )
Expenses 5
Revenue -
Average Order Amount 5 ($\color{orange}{\text{ 2 }}$ )

Option 1:

Models Failed Tests Tests
model1 8 $\color{green}{\text{ (↑ 1) }}$
model2 ❌ 3 $\color{green}{\text{ (↑ 3)}}$ 8
model3 5 $\color{red}{\text{ (↓ 1) }}$
model4 - -
model5 8
model6 8

Option2

Models Test Results Tests
model1 8 $\color{green}{\text{ (↑ 1) }}$
model2 ❌ 3 $\color{green}{\text{ (↑ 3)}}$ 8
model3 5 $\color{red}{\text{ (↓ 1) }}$
model4 - -
model5 8
model6 8

Option 3:

Models Failed Tests
model1 0 / 8 $\color{green}{\text{ (↑ 1) }}$
model2 3 $\color{green}{\text{ (↑ 3)}}$ / 8
model3 0 / 5 $\color{red}{\text{ (↓ 1) }}$
model4 -
model5 0 / 8
model6 0 / 8

Option 4:

Models Failed Tests
model1 0 / 8
model2 3 / 8
model3 0 / 5
model4 -
model5 0 / 8
model6 0 / 8

Option 5

Models Test Result
model1 ✅ / 8
model2 ❌ 3 / 8
model3 ✅ / 5
model4 -
model5 ✅ / 8
model6 ✅ / 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment