Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example-show-changed-assets #70

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
7 changes: 7 additions & 0 deletions dbt_project/models/ANALYTICS/location_stats.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
select
order_date,
state,
count(*) as n_orders,
sum(order_total) as total_revenue
from {{ ref("orders_augmented") }}
group by 1, 2
1 change: 1 addition & 0 deletions dbt_project/models/CLEANED/orders_cleaned.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ select
sku,
dt,
cast(dt as datetime) as order_date,
date_trunc('month', order_date) as order_month,
quantity * purchase_price as order_total
from {{ source("raw_data", "orders") }}
{% if is_incremental() %}
Expand Down
2 changes: 1 addition & 1 deletion hooli_data_eng/assets/dbt_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _process_partitioned_dbt_assets(context: AssetExecutionContext, dbt: DbtCliR
@dbt_assets(
manifest=DBT_MANIFEST,
project=dbt_project,
select="orders_cleaned users_cleaned orders_augmented",
select="orders_cleaned users_cleaned orders_augmented location_stats",
partitions_def=daily_partitions,
dagster_dbt_translator=CustomDagsterDbtTranslator(
settings=DagsterDbtTranslatorSettings(
Expand Down
2 changes: 1 addition & 1 deletion hooli_data_eng/resources/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_orders(self, datetime_to_process):

# random order data returned, see utils.py
json = random_data(
extra_columns={"order_id": str, "quantity": int, "purchase_price": float, "sku": str},
extra_columns={"order_id": str, "order_desc": str, "quantity": int, "purchase_price": float, "sku": str},
n = 10,
filter_date=datetime_to_process
).to_json()
Expand Down
Loading