Conversation
PR SummaryHigh Risk Overview Refactors Tightens lineage and output semantics. Reviewed by Cursor Bugbot for commit 5b846fa. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: CI test date accidentally committed to production code
- Restored
sui_transfer_start_dateto2023-04-12and removed the temporary CI-only comment in all three affected Sui transfer models.
- Restored
Or push these changes by commenting:
@cursor push 5ba09020f2
Preview (5ba09020f2)
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql
@@ -13,7 +13,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
withYou can send follow-ups to this agent here.
0xRobin
left a comment
There was a problem hiding this comment.
If this is a data quality fix, can we add seed test records that were previously incorrect and are now corrected by this change?
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Window function inside CASE inflates candidate rank numbers
- Replaced
row_number()with a running SUM of candidate-only flags socandidate_rankincrements only across candidate transfer types within each partition.
- Replaced
Or push these changes by commenting:
@cursor push c0a4e7bc20
Preview (c0a4e7bc20)
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
@@ -231,9 +231,20 @@
'ownership_balance_topup',
'ownership_balance_spend'
)
- then row_number() over (
+ then sum(
+ case
+ when o.transfer_type in (
+ 'object_created',
+ 'object_deleted',
+ 'ownership_balance_topup',
+ 'ownership_balance_spend'
+ ) then 1
+ else 0
+ end
+ ) over (
partition by o.tx_digest, o.coin_type_normalized, o.amount_raw, o.transfer_direction
order by o.unique_key
+ rows between unbounded preceding and current row
)
else cast(null as bigint)
end as candidate_rankYou can send follow-ups to the cloud agent here.
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Test-only start date committed across all production models
- Restored
sui_transfer_start_datefrom the CI test value2026-01-01to the production value2023-04-12in all eight affected Sui transfer models.
- Restored
Or push these changes by commenting:
@cursor push 54a03b74cd
Preview (54a03b74cd)
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/sui_coin_info.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/sui_coin_info.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/sui_coin_info.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/sui_coin_info.sql
@@ -10,7 +10,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
-- ranking policy:
-- choose the most recent metadata snapshot first (checkpoint/version),
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_base_transfers.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_coin_object_history.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_coin_object_history.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_coin_object_history.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_coin_object_history.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_direct_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_direct_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_direct_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_direct_transfers.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_object_event_deltas.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_object_event_deltas.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_object_event_deltas.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_object_event_deltas.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_owner_net_transfers.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_supply_events.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_supply_events.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_supply_events.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_supply_events.sql
@@ -12,7 +12,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
with
diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql
--- a/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql
+++ b/dbt_subprojects/tokens/models/transfers_and_balances/sui/tokens_sui_transfers.sql
@@ -13,7 +13,7 @@
)
}}
-{% set sui_transfer_start_date = '2026-01-01' %} -- just ci test
+{% set sui_transfer_start_date = '2023-04-12' %}
withYou can send follow-ups to the cloud agent here.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5b846fa. Configure here.


Thank you for contributing to Spellbook 🪄
Please open the PR in draft and mark as ready when you want to request a review.
Description:
refactor baseline (per feat: add SUI USDC stablecoin transfer model #9521): reworked sui transfer lineage to follow event-native supply handling from
sui.events(treasury::mint/treasury::burn) instead of heuristic supply taggingtokens_sui_coin_object_history: kept lineage behavior but aligned branch config/windowing for the ci test slice used in this refactortokens_sui_object_event_deltas: refactored to optimise deleted-object handling to build anchors from active-window object ids first, then prune deleted rows that cannot survive downstream lag filteringtokens_sui_owner_net_transfers: use object events to build tx context, so we don’t miss transfers when direct data is emptytokens_sui_supply_events: added new event-native mint/burn model and removedtokens_sui_supply_signals; parses amount/coin/event direction directly from treasury eventstokens_sui_base_transfers: switched from supply-signal enrichment to a union of non-supply object lineage rows plus event-native supply rows, and adjusted supply dedupe/matching around tx+coin+direction+amounttokens_sui_transfers: use rawfrom/toinstead of filled-infrom_resolved/to_resolved- this means more nulls, but fewer fake addresses/self-transfersseed test records were added/updated to cover rows that were previously incorrect and are now corrected by this change
quick links for more information: