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

update asset checks API #42

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hooli_data_eng/assets/marketing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def avg_orders(context: AssetExecutionContext, company_perf: pd.DataFrame) -> pd
def check_avg_orders(context, avg_orders: pd.DataFrame):
avg = avg_orders['avg_order'][0]
return AssetCheckResult(
success= True if (avg < 50) else False,
passed= True if (avg < 50) else False,
metadata={"actual average": avg, "threshold": 50}
)

Expand Down
2 changes: 1 addition & 1 deletion hooli_data_eng/assets/raw_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def users(context, api: RawDataAPI) -> pd.DataFrame:
def check_users(context, users: pd.DataFrame):
unique_companies = pd.unique(users['company']).tolist()
return AssetCheckResult(
success= (unique_companies == ["FoodCo", "ShopMart", "SportTime", "FamilyLtd"]),
passed= (unique_companies == ["FoodCo", "ShopMart", "SportTime", "FamilyLtd"]),
metadata={"companies": unique_companies},
severity=AssetCheckSeverity.WARN
)
Expand Down
Loading