Skip to content

Commit

Permalink
fixing notebook for real
Browse files Browse the repository at this point in the history
  • Loading branch information
slopp committed Oct 23, 2023
1 parent db58d9b commit 8aea0ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hooli_data_eng/assets/forecasting/model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"\n",
"print(len(weekly_order_summary))\n",
"\n",
"combined = pd.concat(weekly_order_summary, daily_order_preds)\n",
"combined = pd.concat([weekly_order_summary, daily_order_preds])\n",
"(ggplot(combined, aes('order_date', 'num_orders', color = 'type')) + geom_point(alpha = 0.5) + stat_smooth(method='lm'))\n",
"\n",
"# - Interactive plots (not currently supported in dagit notebook rendering)\n",
Expand Down Expand Up @@ -108,7 +108,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.13 (main, Aug 24 2023, 22:43:20) [Clang 14.0.0 (clang-1400.0.29.202)]"
},
"orig_nbformat": 4,
"vscode": {
Expand Down
12 changes: 10 additions & 2 deletions hooli_data_eng/assets/raw_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ def users(context, api: RawDataAPI) -> pd.DataFrame:

return pd.concat(all_users)

@asset
def clean_users(users):
#users = flatten(users)
return users

@asset_check(
asset=AssetKey(["RAW_DATA", "users"]),
asset=users,#AssetKey(["RAW_DATA", "users"]),
description="check that users are from expected companies",
)
def check_users(context, users: pd.DataFrame):
Expand Down Expand Up @@ -88,4 +93,7 @@ def orders(context, api: RawDataAPI) -> pd.DataFrame:

all_orders_df = pd.concat(all_orders)
all_orders_df['dt'] = pd.to_datetime(all_orders_df['dt'], unit = "ms")
return all_orders_df
return all_orders_df


from dagster_dbt import dbt_assets

0 comments on commit 8aea0ba

Please sign in to comment.