Skip to content

Commit

Permalink
fix(dex): add mock tx_from and tx_to in test view
Browse files Browse the repository at this point in the history
- Add mock fields for testing only
- Use evt_tx_hash as a placeholder
- Keep production code unchanged
  • Loading branch information
Hosuke committed Jan 7, 2025
1 parent 8bcdb96 commit 40a95bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dbt_subprojects/dex/models/trades/test/dex_ci_trades_test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
{% set modified_models = get_modified_base_trades() %}
{% set git_schema = 'git_dunesql_' ~ env_var('GIT_SHA', '') %}

WITH base_union AS (
WITH base_trades AS (
{% for file in modified_models %}
{% set model_name = file.split('/')[-1].replace('.sql', '') %}
SELECT *
SELECT
*,
evt_tx_hash as tx_from, -- For testing only, not used in production
evt_tx_hash as tx_to -- For testing only, not used in production
FROM delta_prod.test_schema.{{ git_schema }}_{{ model_name }}
WHERE block_date = current_date - interval '1' day
{% if not loop.last %}
Expand All @@ -27,7 +30,7 @@ WITH base_union AS (
SELECT * FROM (
{{
enrich_dex_trades(
base_trades = 'base_union'
base_trades = 'base_trades'
, tokens_erc20_model = source('tokens', 'erc20')
, filter = "1=1"
)
Expand Down

0 comments on commit 40a95bb

Please sign in to comment.