Skip to content

Gtas Slaughterhouses Taxn

s3://trase-storage/brazil/logistics/gta/silver/gtas_slaughterhouses_taxn.parquet

Dbt path: trase_production.main_brazil.gtas_slaughterhouses_taxn

Explore on Metabase: Full table; summary statistics

Containing yaml file link: trase/data_pipeline/models/brazil/logistics/gta/_schema_brazil_gta.yml

Model file link: trase/data_pipeline/models/brazil/logistics/gta/silver/gtas_slaughterhouses_taxn.py

Dbt test runs & lineage: Test results ยท Lineage

Full dbt_docs page: Open in dbt docs (includes lineage graph -at the bottom right-, tests, and downstream dependencies)

Tags: brazil, logistics, beef, farms


gtas_slaughterhouses_taxn

Description

Takes the BigQuery GTAs (dopastoaoprato-278fd.gtas.gtas_consolidated_2025_02) and for the records with FINAL_MOVEMET = TRUE , takes the distinct DESTINATION_TAX_NUMBER.


Details

Column Type Description

No called script or script source not found.

import importlib
from trase import ROOT

# Load the script doing the BigQuery GTA logic as a module
script_path = (
    f"{ROOT}/trase/data/brazil/logistics/gta/get_bigquery_farms_and_slaughterhouses.py"
)

spec = importlib.util.spec_from_file_location(
    "get_bigquery_farms_and_slaughterhouses", script_path
)
get_bigquery_farms_and_slaughterhouses = importlib.util.module_from_spec(spec)
spec.loader.exec_module(get_bigquery_farms_and_slaughterhouses)


def model(dbt, cursor):
    dbt.config(materialized="external")

    try:
        slaughterhouse_taxn_df = (
            get_bigquery_farms_and_slaughterhouses.get_slaughterhouses_taxn_from_gtas()
        )
    except Exception as e:
        print(
            f"An error occurred: {str(e)}"
        )  # Print the string representation of the error
        print(f"Error type: {type(e).__name__}")  # Print the type of the exception
        print(f"Error arguments: {e.args}")  # Print the arguments of the exception
        raise  # Optionally re-raise the exception to halt further execution

    return slaughterhouse_taxn_df