diff --git a/warehouse/dbt/models/intermediate/blockchain_events/int_base_traces.sql b/warehouse/dbt/models/intermediate/blockchain_events/int_base_traces.sql index a2014c62..204723cf 100644 --- a/warehouse/dbt/models/intermediate/blockchain_events/int_base_traces.sql +++ b/warehouse/dbt/models/intermediate/blockchain_events/int_base_traces.sql @@ -11,4 +11,19 @@ incremental_strategy="insert_overwrite" ) }} -{{ filtered_blockchain_events("BASE", "base", "traces") }} + +with base_traces as ( + {{ filtered_blockchain_events("BASE", "base", "traces") }} +), + +transformed_traces as ( + select + *, + CAST(`value` as FLOAT64) as numeric_value + from base_traces +) + +select + * except (`value`, numeric_value), + numeric_value as `value` +from transformed_traces diff --git a/warehouse/dbt/models/marts/superchain/4337_traces.sql b/warehouse/dbt/models/marts/superchain/4337_traces.sql index 51c2555e..b8b7c3d9 100644 --- a/warehouse/dbt/models/marts/superchain/4337_traces.sql +++ b/warehouse/dbt/models/marts/superchain/4337_traces.sql @@ -58,7 +58,19 @@ with filtered_traces as ( {{ final_query }} +), + +transformed_traces as ( + select + *, + case + when network = 'BASE' then CAST(`value` as FLOAT64) + else `value` + end as numeric_value + from filtered_traces ) -select * -from filtered_traces +select + * except (`value`, numeric_value), + numeric_value as `value` +from transformed_traces diff --git a/warehouse/oso_dagster/assets/base.py b/warehouse/oso_dagster/assets/base.py index d312272c..e9c25e90 100644 --- a/warehouse/oso_dagster/assets/base.py +++ b/warehouse/oso_dagster/assets/base.py @@ -1,7 +1,13 @@ from ..factories.goldsky import goldsky_network_assets +from ..factories.goldsky.config import NetworkAssetSourceConfigDict base_network = goldsky_network_assets( network_name="base", destination_dataset_name="superchain", working_destination_dataset_name="oso_raw_sources", + traces_config=NetworkAssetSourceConfigDict( + schema_overrides=[ + {"name": "value", "field_type": "STRING"}, + ] + ), )