Skip to content

DBT Test: Dbt Utils Accepted Range Comtrade Exports Reporter Code 2000 0

DBT test name: dbt_utils_accepted_range_comtrade_exports_reporter_code__2000__0

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_69f4e03afef859541d719060565eaedb") }}
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 reporter_code >= 0
    -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.
    or not reporter_code <= 2000
)

select *
from validation_errors