Skip to content

Commit

Permalink
fix syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
sophie-analytics committed Oct 2, 2024
1 parent 34a1071 commit 9d29729
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['day', 'address', 'token_address', 'token_id'],
unique_key = ['day', 'address', 'token_address', 'unique_key_id'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.day')]
)
}}
Expand All @@ -28,7 +28,8 @@ alchemy_addresses as (
)

select
*
*,
coalesce(token_id, uint256 '1') as unique_key_id ---using this to add a unique key to the table as erc20 has no token_id
from balances
where token_address not in (
0xd74f5255d557944cf7dd0e45ff521520002d5748, --$9.8B were minted in a hack in 2023, all of which are stored in a Safe. Filtering out.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ models:
- day
- address
- token_address
- token_id
- unique_key_id
columns:
- &blockchain
name: blockchain
Expand Down Expand Up @@ -52,4 +52,7 @@ models:
description: "UTC timestamp when data was last updated"
- &next_update
name: next_update
description: "UTC timestamp when data is next updated"
description: "UTC timestamp when data is next updated"
- &unique_key_id
name: unique_key_id
description: " unique key to the table as erc20 has no token_id"

0 comments on commit 9d29729

Please sign in to comment.