Skip to content

DBT Test: Municipality State Trase Id In Ibge States 2023

DBT test name: municipality_state_trase_id_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
    state_trase_id as id

  from 's3://trase-storage/brazil/dictionaries/municipality.csv'

  where state_trase_id is not null
    and state_trase_id <> 'BR-IM'

),

right_table as (

  select
    trase_id as id

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

  where trase_id 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