Filter test, sample, and internal orders from production sales reporting
harbor run -t snowflake-labs/dbt-test-orders-filterharbor download snowflake-labs/dbt-test-orders-filterThe company's sales reports are including non-production orders. Finance has noticed that revenue numbers are slightly inflated because test orders, sample orders, and internal orders are being counted in production reports.
Investigate the orders data to understand which orders should be excluded from production reporting. Then create a dbt model that produces a clean production_sales table containing only legitimate customer orders.
/app/dbt_models_duckdb/ (run dbt deps before dbt run)/app/dbt_models_snowflake/ (run dbt deps before dbt run)This task supports both DuckDB and Snowflake. Run echo $DB_TYPE in a shell BEFORE you write any code or spawn any subagents — the live env determines which backend the verifier runs against. Do NOT assume a default from this prose. Both /app/dbt_models_duckdb/ and /app/dbt_models_snowflake/ exist on disk; the verifier only checks the project matching the live $DB_TYPE.
DB_TYPE=duckdb$DUCKDB_PATH (default: /app/database/retail.duckdb)DB_TYPE=snowflakeSNOWFLAKE_ACCOUNTSNOWFLAKE_USERSNOWFLAKE_PASSWORDSNOWFLAKE_DATABASE - The clone database to useSNOWFLAKE_SCHEMASNOWFLAKE_WAREHOUSESNOWFLAKE_ROLE (optional)Note: For Snowflake, the entrypoint automatically creates a clone database and sets SNOWFLAKE_DATABASE. The clone is destroyed when the task completes.
You must configure dbt to connect to the database:
profiles.yml in the dbt project directory with profile name retail_dw_masterDBT_PROFILES_DIR environment variable to the directory containing profiles.ymlConfigure with type: duckdb and the database path from $DUCKDB_PATH.
Configure with type: snowflake using password authentication:
schema: to $SNOWFLAKE_SCHEMA — do NOT leave it blank. A blank or omitted schema makes Snowflake silently default to PUBLIC, so your models get built in the wrong schema and the verifier cannot find them.main.production_sales| Column | Type | Description |
|---|---|---|
order_id |
VARCHAR | Unique order identifier |
customer_id |
VARCHAR | Customer identifier |
order_date |
DATE | Date the order was placed |
grand_total |
DECIMAL | Order total amount |
status |
VARCHAR | Order status |