DBT Test: Dbt Expectations Expect Table Aggregation To Equal Other Table Brazil Bol 2023 Mdic Padded Source Source Brazil Original Brazil Soy Beef Bol 2023 Count 0 03
DBT test name: dbt_expectations_expect_table_aggregation_to_equal_other_table_brazil_bol_2023_mdic_padded_source_source_brazil_original_brazil_soy_beef_bol_2023___count___0_03
DBT details
-
Kind:
generic(expect_table_aggregation_to_equal_other_table) -
Test file: trase/data_pipeline/models/brazil/trade/bol/_schema_brazil_bol.yml
Description
No description
Details
Models
Sources
Macros
test_expect_table_aggregation_to_equal_other_tableget_where_subquery
{{ dbt_expectations.test_expect_table_aggregation_to_equal_other_table(**_dbt_generic_test_kwargs) }}{{ config(severity="warn",alias="dbt_expectations_expect_table__a0481118cc7179552464dbb4e70385fe") }}
with a as (
select
count(*) as expression
from
"trase_production"."main_brazil"."brazil_bol_2023_mdic_padded"
),
b as (
select
count(*) as expression
from
read_csv('s3://trase-storage/brazil/trade/bol/2023/originals/brazil_soy_beef_DataLiner_17-12-2024_utf.csv', all_varchar=true)
),
final as (
select
a.expression,
b.expression as compare_expression,
abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,
abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/
nullif(a.expression * 1.0, 0) as expression_difference_percent
from
a cross join b
)
-- DEBUG:
-- select * from final
select
*
from final
where
expression_difference_percent > 0.03