Skip to content

DBT Test: Dbt Expectations Expect Table Aggregation To Equal Other Table Brazil Bol 2023 Gold 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_gold_source_source_brazil_original_brazil_soy_beef_bol_2023___count___0_03

DBT details


Description

No description


Details

Models

Sources

Macros

  • test_expect_table_aggregation_to_equal_other_table
  • get_where_subquery
{{ dbt_expectations.test_expect_table_aggregation_to_equal_other_table(**_dbt_generic_test_kwargs) }}{{ config(severity="warn",alias="dbt_expectations_expect_table__4f96bf8bdceb0b82ff85adef6b4b1e6a") }}
    with a as (

    select

        count(*) as expression
    from
        "trase_production"."main_brazil"."brazil_bol_2023_gold"


    ),
    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