DBT: Gold Tanzania Trade Coffee 2020
File location: s3://trase-storage/tanzania/trade/2020/gold/gold_tanzania_trade_coffee_2020.parquet
DBT model name: gold_tanzania_trade_coffee_2020
Explore on Metabase: Full table; summary statistics
Explore dependencies/lineage: link
Description
....
Details
| Column | Type | Description |
|---|---|---|
year |
INTEGER |
|
exporter_label |
VARCHAR |
|
exporter_node_id |
INTEGER |
|
exporter_group_name |
VARCHAR |
|
country_of_destination |
VARCHAR |
|
mass_tonnes |
DOUBLE |
|
fob |
DOUBLE |
|
importer_label |
VARCHAR |
|
port_of_export_label |
VARCHAR |
|
hs6 |
VARCHAR |
Review full report including sample errors records if they exist (link)
| Test name | Test column | Last test run | Last status |
|---|---|---|---|
check_bol_against_comtrade_gold_tanzania_trade_coffee_2020_TZA__0901__2101__mass_tonnes__2020 |
`` | 2026-04-25 13:23 | warn |
accepted_values_gold_tanzania_trade_coffee_2020_hs6__090111__090112__090121__090122__090190__210111__210112 |
hs6 |
2026-04-25 13:23 | pass |
check_trader_groups_gold_tanzania_trade_coffee_2020_exporter_group_name__2020 |
`` | 2026-04-25 13:23 | pass |
dbt_utils_expression_is_true_gold_tanzania_trade_coffee_2020_fob___0 |
fob |
2026-04-25 13:23 | pass |
dbt_utils_expression_is_true_gold_tanzania_trade_coffee_2020_mass_tonnes___0 |
mass_tonnes |
2026-04-25 13:23 | pass |
not_null_gold_tanzania_trade_coffee_2020_fob |
fob |
2026-04-25 13:23 | pass |
not_null_gold_tanzania_trade_coffee_2020_hs6 |
hs6 |
2026-04-25 13:23 | pass |
not_null_gold_tanzania_trade_coffee_2020_mass_tonnes |
mass_tonnes |
2026-04-25 13:23 | pass |
relationships_gold_tanzania_trade_coffee_2020_country_of_destination__country_name__ref_postgres_countries_ |
country_of_destination |
2026-04-25 13:23 | pass |
Sources
No called script or script source not found.
# gold_tanzania_trade_coffee_2020
from trase.data.tanzania.trade.y2020.tanzania_coffee_2020 import (
get_tanzania_coffee_2020,
)
def model(dbt, session):
dbt.config(materialized="external")
session.execute("INSTALL spatial; LOAD spatial;")
# Declaring the sources so they appear in the documentation / lineage
comtrade_data = dbt.source(
"source_tanzania_trade", "original_tanzania_comtrade_2020"
)
trade_data = dbt.source("source_tanzania_trade", "original_tanzania_exports_2020")
df = get_tanzania_coffee_2020()
export_data = session.sql(
f"""
WITH final_fields AS (
SELECT
YEAR::INT AS year,
EXPORTER_NAME_ORIGINAL AS exporter_label,
EXPORTER_ID AS exporter_node_id,
EXPORTER_GROUP AS exporter_group_name,
COUNTRY_DESTINATION AS country_of_destination,
NET_WEIGHT/1000 AS mass_tonnes,
FOB_VALUE_IN_USD AS fob,
BUYER_NAME AS importer_label,
PORT_NAME AS port_of_export_label,
HS_CODE AS hs6
FROM df
)
SELECT * FROM final_fields
"""
).arrow()
return export_data
-
Dbt path:
trase_production.main_tanzania_coffee.gold_tanzania_trade_coffee_2020 -
Containing yaml link: trase/data_pipeline/models/tanzania/trade/2020/gold/_schema.yml
-
Model file: trase/data_pipeline/models/tanzania/trade/2020/gold/gold_tanzania_trade_coffee_2020.py
-
Tags:
gold,tanzania,coffee,trade,2020,diet-trase-coffee