DBT Test: Brazil Mdic Port 2023 Via Fkey
DBT test name: brazil_mdic_port_2023_via_fkey
DBT details
-
Kind:
generic(relationships) -
Column under test:
via -
Test file: trase/data_pipeline/models/brazil/trade/mdic/port/_schema.yml
Description
No description
Details
{{ test_relationships(**_dbt_generic_test_kwargs) }}
with child as (
select via as from_field
from "trase_production"."main_brazil"."brazil_mdic_port_2023"
where via is not null
),
parent as (
select mdic_via_code as to_field
from read_csv('s3://trase-storage/brazil/trade/mdic/port/mdic_via_codes.csv', all_varchar=true)
)
select
from_field
from child
left join parent
on child.from_field = parent.to_field
where parent.to_field is null