Skip to content

DBT Test: Distance Cutoff Geocode In Ibge States 2023

DBT test name: distance_cutoff_geocode_in_ibge_states_2023

DBT details


Description

No description


Details

Models

Sources

Macros

  • test_relationships_where
  • get_where_subquery
{{ dbt_utils.test_relationships_where(**_dbt_generic_test_kwargs) }}
with left_table as (

  select
    GEOCODE as id

  from 's3://trase-storage/brazil/logistics/freight/distance_cutoff.csv'

  where GEOCODE is not null
    and 1=1

),

right_table as (

  select
    ibge_state_code as id

  from "memory"."main"."brazil_ibge_states_gold"

  where ibge_state_code is not null
    and year = 2023

),

exceptions as (

  select
    left_table.id,
    right_table.id as right_id

  from left_table

  left join right_table
         on left_table.id = right_table.id

  where right_table.id is null

)

select * from exceptions