Skip to content

Commit

Permalink
fix(test): cast address fields to varbinary in dex_ci_trades_test
Browse files Browse the repository at this point in the history
- Explicitly list all fields instead of using SELECT *
- Cast address fields to varbinary to match expected types
  • Loading branch information
Hosuke committed Jan 7, 2025
1 parent fb4cd85 commit f284879
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion dbt_subprojects/dex/models/trades/test/dex_ci_trades_test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@ WITH base_trades AS (
{% for file in modified_models %}
{% set model_name = file.split('/')[-1].replace('.sql', '') %}
SELECT
*,
blockchain,
project,
version,
block_month,
block_date,
block_time,
block_number,
token_bought_amount_raw,
token_sold_amount_raw,
CAST(token_bought_address AS varbinary) as token_bought_address,
CAST(token_sold_address AS varbinary) as token_sold_address,
CAST(taker AS varbinary) as taker,
CAST(maker AS varbinary) as maker,
CAST(project_contract_address AS varbinary) as project_contract_address,
tx_hash,
evt_index,
cast(null as varbinary) as tx_from, -- For testing only, not used in production
cast(null as varbinary) as tx_to -- For testing only, not used in production
FROM delta_prod.test_schema.{{ git_schema }}_{{ model_name }}
Expand Down

0 comments on commit f284879

Please sign in to comment.