Skip to content

DBT Test: Dbt Utils Accepted Range Comtrade Exports Reference Year 2100 1960

DBT test name: dbt_utils_accepted_range_comtrade_exports_reference_year__2100__1960

DBT details


Description

No description


Details

Models

Macros

  • test_accepted_range
  • get_where_subquery
{{ dbt_utils.test_accepted_range(**_dbt_generic_test_kwargs) }}{{ config(alias="dbt_utils_accepted_range_comtr_22c6777536e44687396a519e84e91920") }}
with meet_condition as(
  select *
  from "trase_production"."main"."comtrade_exports"
),

validation_errors as (
  select *
  from meet_condition
  where
    -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds
    1 = 2
    -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.
    or not reference_year >= 1960
    -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.
    or not reference_year <= 2100
)

select *
from validation_errors