Reviews of Public Pull Requests

konstruct review with the URL of a public GitHub pull request fetches the pull request into a temporary partial clone, reads its dbt project without running anything from the repository, and prints the review (A Pull Request on GitHub). Each review below starts with the line a pull request comment opens with, then the list a reviewer sees under it; the part for engineers (the column-level changes, the dbt build command and each formula composed down to its sources) is left out.

These 11 merged pull requests were chosen from 175 reviewed, and each review is shown as konstruct review prints it. uv run .kodex/scripts/review_gallery.py reviews them again and rewrites this page.

Changes to Business Numbers

derekschultz/nhl-data-pipeline#3

derekschultz/nhl-data-pipeline#3: Keeps games whose state is OFF as well as FINAL in stg_games, so every standing computed from it counts more games.

$ konstruct review https://github.com/derekschultz/nhl-data-pipeline/pull/3
Konstruct: Is home win: rows now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL'); away losses: the rows it joins now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL'); 9 more numbers computed in the SQL may change meaning (check each)

11 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- is home win (stg_games): rows now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL').
- away losses (mart_team_standings): the rows it joins now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL').
- away wins (mart_team_standings): the rows it joins now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL').
- games played (mart_team_standings): the rows it joins now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL').
- home losses (mart_team_standings): the rows it joins now need game.game_state IN ('FINAL', 'OFF') (was game.game_state = 'FINAL').

6 more, in 1 model:

- mart_team_standings (6): home wins, losses, otl, points, win pct, wins

admmpy/fpl-dbt-sf#3

admmpy/fpl-dbt-sf#3: Divides each player’s now_cost by 10 in staging, a change of unit that reaches the current value in dim_players.

$ konstruct review https://github.com/admmpy/fpl-dbt-sf/pull/3
Konstruct: Current value: is now [now cost] divided by 10.0, not [now cost]; 2 more numbers computed in the SQL may change meaning (check each); 1 more proposed number was not compared

- Not checked: total points (measure column: player_gameweek; fct_players_gameweek.total_points) is no longer proposed as a number at the head, though fct_players_gameweek.total_points is still there, so it was not checked.

3 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- current value (dim_players): is now [now cost] divided by 10.0, not [now cost].
- player gameweek value (fct_ml_player_features): is computed over other rows.
- minutes played (fct_ml_player_features): is computed over other rows.

KacperChojnacki1337/cs2-market-data-platform#85

KacperChojnacki1337/cs2-market-data-platform#85: Raises the Skinport sale fee from 5% to 8% in fct_realized_pnl, so the fee and the net sale price of every item sold on Skinport change.

$ konstruct review https://github.com/KacperChojnacki1337/cs2-market-data-platform/pull/85
Konstruct: Fee amount pln and net sell price pln: its formula has 8.0 where it had 5.0

2 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- fee amount pln (fct_realized_pnl): its formula has 8.0 where it had 5.0.
- net sell price pln (fct_realized_pnl): its formula has 8.0 where it had 5.0.

vbalalian/estore-analytics#151

vbalalian/estore-analytics#151: Counts each user’s sessions from the cleaned sessions model, which splits sessions at an hour of inactivity, instead of counting distinct session ids in the events, and gives 0 to a user with none.

$ konstruct review https://github.com/vbalalian/estore-analytics/pull/151
Konstruct: Session count: is now the first of (the number of rows, 0) that has a value, not the number of distinct values of [user session]; avg session count: is now ROUND(AVG(COALESCE(COUNT(*), 0)), 2) (was ROUND(AVG(COUNT(DISTINCT events.user_session)), 2)); 3 more numbers computed in the SQL may change meaning (check each)

5 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- session count (dim_users): is now the first of (the number of rows, 0) that has a value, not the number of distinct values of [user session].
- total churned (metrics_rfm_segments): has a new formula.
- avg lifespan days (metrics_rfm_segments): has a new formula.
- avg session count (metrics_rfm_segments): is now ROUND(AVG(COALESCE(COUNT(*), 0)), 2) (was ROUND(AVG(COUNT(DISTINCT events.user_session)), 2)).
- churn rate (metrics_rfm_segments): has a new formula.

rlancaster243/Project-Ledger#2

rlancaster243/Project-Ledger#2: Adds the period start date to the key fct_financial_facts deduplicates on, so facts that end on the same date but cover different periods, such as a quarter and a year to date, are no longer collapsed into one.

$ konstruct review https://github.com/rlancaster243/Project-Ledger/pull/2
Konstruct: Financial fact value and accession number: the condition on its rows now also partitions by CAST(jsonl.period_start_date AS DATE)

2 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- financial fact value (fct_financial_facts): the condition on its rows now also partitions by CAST(jsonl.period_start_date AS DATE).
- accession number (fct_financial_facts): the condition on its rows now also partitions by CAST(jsonl.period_start_date AS DATE).

azhangd/nba-analytics-duckdb#54

azhangd/nba-analytics-duckdb#54: Stops counting a coach’s challenge as a timeout, so each team season’s after-timeout scoring and stop rates and its timeout counts change.

$ konstruct review https://github.com/azhangd/nba-analytics-duckdb/pull/54
Konstruct: Ato def ppp, ato ppp and ato score pct: rows now need LOWER(COALESCE(play_by_play.sub_type, '')) NOT LIKE '%challenge%'; 19 more numbers computed in the SQL, in 5 models, may change meaning (check each)

22 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- ato def ppp (team_season_ato_stats): rows now need LOWER(COALESCE(play_by_play.sub_type, '')) NOT LIKE '%challenge%'.
- ato ppp (team_season_ato_stats): rows now need LOWER(COALESCE(play_by_play.sub_type, '')) NOT LIKE '%challenge%'.
- ato score pct (team_season_ato_stats): rows now need LOWER(COALESCE(play_by_play.sub_type, '')) NOT LIKE '%challenge%'.
- ato stop pct (team_season_ato_stats): rows now need LOWER(COALESCE(play_by_play.sub_type, '')) NOT LIKE '%challenge%'.
- ato turnover pct (team_season_ato_stats): rows now need LOWER(COALESCE(play_by_play.sub_type, '')) NOT LIKE '%challenge%'.

17 more, in 5 models:

- team_season_timeout_stats (8): avg clock when called q4, clutch timeout pct, clutch timeouts, ot timeouts, q1 timeouts, q2 timeouts, q3 timeouts, q4 timeouts
- player_season_stats_base (3): fg pct, fg3 pct, ft pct
- team_season_feature_matrix (3): mid freq, paint freq, three freq
- player_season_split_stats (2): net rating, usg pct
- team_season_ato_stats (1): clutch ato ppp

iankressin/block-juice#75

iankressin/block-juice#75: Keeps only the event logs of the Polymarket exchange source in its staging model, as the source now also holds the fills’ transactions, so the price candles and each participant’s fees and positions are computed over logs alone.

$ konstruct review https://github.com/iankressin/block-juice/pull/75
Konstruct: Fees usdc: the rows it joins now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'; high: rows now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'; 6 more numbers computed in the SQL may change meaning (check each)

8 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- fees usdc (polymarket_market_participants): the rows it joins now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'.
- high (polymarket_price_candles): rows now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'.
- low (polymarket_price_candles): rows now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'.
- net cash usdc (polymarket_market_participants): the rows it joins now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'.
- open shares (polymarket_market_participants): the rows it joins now need JSON_EXTRACT_SCALAR(polygon_polymarket_ctf_exchange_v2.data, '$.kind') = 'log'.

3 more, in 2 models:

- polymarket_price_candles (2): shares volume, usdc volume
- int_polygon_polymarket_ctf_exchange_v2_fills (1): is taker order

jeremy6680/databird-local-bike#9

jeremy6680/databird-local-bike#9: Builds the order revenue once per order in a new model read from the orders, so the completed order count in customer_summary counts every completed order, not only those with order items.

$ konstruct review https://github.com/jeremy6680/databird-local-bike/pull/9
Konstruct: Completed order count: its formula has orders.order_id where it had order_items.order_id; 13 more numbers computed in the SQL, in 5 models, may change meaning (check each)

14 numbers computed in the SQL may change meaning (proposed by Konstruct, check each):

- lifetime value (customer_summary): has a new formula and is computed over other rows.
- total revenue (top_products): has a new formula and is computed over other rows.
- total revenue (revenue_by_category): has a new formula and is computed over other rows.
- avg basket (customer_summary): has a new formula and is computed over other rows.
- completed order count (customer_summary): its formula has orders.order_id where it had order_items.order_id.

9 more, in 5 models:

- revenue_by_store (3): avg order revenue, total revenue, order count
- revenue_by_category (2): order count, units sold
- top_products (2): order count, units sold
- customer_summary (1): total order count
- int_orders__enriched (1): delivery delay days

DiogoSoares3/desafio-analytics#16

DiogoSoares3/desafio-analytics#16: Removes the online-only filter from the sales order header staging model, so every amount and count computed over it covers all sales channels.

$ konstruct review https://github.com/DiogoSoares3/desafio-analytics/pull/16
Konstruct: Row logic changed in stg_adventure_works__salesorderheader: rows no longer need salesorderheader.onlineorderflag, which reaches 27 columns; check the numbers computed over its rows

- Rows: in stg_adventure_works__salesorderheader (models/staging/stg_adventure_works__salesorderheader.sql), rows no longer need salesorderheader.onlineorderflag; it reaches 27 columns, and no number listed here shows it.

All Clears

When a change leaves every number as it was, the review is one line.

ianbvaughn/Deep-Cuts#16

ianbvaughn/Deep-Cuts#16: Adds an average response time to the daily API log model; the count of calls per day and status it already had is unchanged.

$ konstruct review https://github.com/ianbvaughn/Deep-Cuts/pull/16
Konstruct: no business number changes meaning (1 column added: gold_api_logs_daily.avg_response_time).

Jiahong-Que-9527/SoloLakehouse#310

Jiahong-Que-9527/SoloLakehouse#310: Moves the euro conversion and the incremental lookback of fct_charging_sessions into macros that render the same SQL, and adds a partition setting that applies on BigQuery only.

$ konstruct review https://github.com/Jiahong-Que-9527/SoloLakehouse/pull/310
Konstruct: no business number changes meaning (3 dbt tests removed, 3 dbt tests added).