DBT Test: Dbt Expectations Expect Table Aggregation To Equal Other Table Brazil Bol 2024 Silver Source Source Brazil Original Brazil Soy Beef Bol 2024 Count 0 03
DBT test name: dbt_expectations_expect_table_aggregation_to_equal_other_table_brazil_bol_2024_silver_source_source_brazil_original_brazil_soy_beef_bol_2024___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__5b5363b608cf49a38bfc68f6481a95bb") }}
with a as (
select
count(*) as expression
from
"memory"."main"."brazil_bol_2024_silver"
),
b as (
select
count(*) as expression
from
read_csv('s3://trase-storage/brazil/trade/bol/2024/bronze/brazil_bol_2024_soy_beef.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