From 8730fccf0c5b9f2b6f65de1e4cb665b678bf61c8 Mon Sep 17 00:00:00 2001 From: B1boid <47173672+B1boid@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:32:12 +0000 Subject: [PATCH] add empty check (#7462) --- .../_projects/bebop/arbitrum/bebop_rfq_arbitrum_trades.sql | 3 ++- .../_projects/bebop/ethereum/bebop_rfq_ethereum_trades.sql | 2 ++ .../_projects/bebop/optimism/bebop_rfq_optimism_trades.sql | 2 ++ .../_projects/bebop/polygon/bebop_rfq_polygon_trades.sql | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dbt_subprojects/dex/models/_projects/bebop/arbitrum/bebop_rfq_arbitrum_trades.sql b/dbt_subprojects/dex/models/_projects/bebop/arbitrum/bebop_rfq_arbitrum_trades.sql index 086a5fb0d6e..ba61af18666 100644 --- a/dbt_subprojects/dex/models/_projects/bebop/arbitrum/bebop_rfq_arbitrum_trades.sql +++ b/dbt_subprojects/dex/models/_projects/bebop/arbitrum/bebop_rfq_arbitrum_trades.sql @@ -1,7 +1,6 @@ {{ config( schema = 'bebop_rfq_arbitrum', alias = 'trades', - tags = ['prod_exclude'], partition_by = ['block_month'], materialized = 'incremental', file_format = 'delta', @@ -58,6 +57,8 @@ bebop_raw_data AS ( {% if is_incremental() %} AND {{ incremental_predicate('evt.evt_block_time') }} {% endif %} + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.maker_tokens')), '$[0]')) > 0 + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.taker_tokens')), '$[0]')) > 0 ), unnested_array_taker AS ( diff --git a/dbt_subprojects/dex/models/_projects/bebop/ethereum/bebop_rfq_ethereum_trades.sql b/dbt_subprojects/dex/models/_projects/bebop/ethereum/bebop_rfq_ethereum_trades.sql index 991f8fc07b4..f96dd8889a3 100644 --- a/dbt_subprojects/dex/models/_projects/bebop/ethereum/bebop_rfq_ethereum_trades.sql +++ b/dbt_subprojects/dex/models/_projects/bebop/ethereum/bebop_rfq_ethereum_trades.sql @@ -57,6 +57,8 @@ bebop_raw_data AS ( {% if is_incremental() %} AND {{ incremental_predicate('evt.evt_block_time') }} {% endif %} + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.maker_tokens')), '$[0]')) > 0 + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.taker_tokens')), '$[0]')) > 0 ), unnested_array_taker AS ( diff --git a/dbt_subprojects/dex/models/_projects/bebop/optimism/bebop_rfq_optimism_trades.sql b/dbt_subprojects/dex/models/_projects/bebop/optimism/bebop_rfq_optimism_trades.sql index 7aa27dfd878..f01482ff868 100644 --- a/dbt_subprojects/dex/models/_projects/bebop/optimism/bebop_rfq_optimism_trades.sql +++ b/dbt_subprojects/dex/models/_projects/bebop/optimism/bebop_rfq_optimism_trades.sql @@ -50,6 +50,8 @@ bebop_raw_data AS ( {% if is_incremental() %} AND {{ incremental_predicate('evt.evt_block_time') }} {% endif %} + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.maker_tokens')), '$[0]')) > 0 + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.taker_tokens')), '$[0]')) > 0 ), unnested_array_taker AS ( diff --git a/dbt_subprojects/dex/models/_projects/bebop/polygon/bebop_rfq_polygon_trades.sql b/dbt_subprojects/dex/models/_projects/bebop/polygon/bebop_rfq_polygon_trades.sql index a2ed8dc0408..625aa4a23c7 100644 --- a/dbt_subprojects/dex/models/_projects/bebop/polygon/bebop_rfq_polygon_trades.sql +++ b/dbt_subprojects/dex/models/_projects/bebop/polygon/bebop_rfq_polygon_trades.sql @@ -57,6 +57,8 @@ bebop_raw_data AS ( {% if is_incremental() %} AND {{ incremental_predicate('evt.evt_block_time') }} {% endif %} + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.maker_tokens')), '$[0]')) > 0 + AND json_array_length(json_extract((JSON_EXTRACT(ex."order", '$.taker_tokens')), '$[0]')) > 0 ), unnested_array_taker AS (