Skip to content

Commit

Permalink
Fix weekly analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
rjambrecic committed Jun 25, 2024
1 parent f428011 commit 0e9d85d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion captn/captn_agents/backend/teams/_weekly_analysis_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@ def execute_weekly_analysis(
day_of_week = None
else:
day_of_week = _get_day_of_week(date)
day_of_week = "Wednesday"
id_email_dict = json.loads(get_user_ids_and_emails(day_of_week=day_of_week))

# if send_only_to_emails is None:
Expand All @@ -1084,6 +1083,8 @@ def execute_weekly_analysis(
print(
f"Failed to create chat for user_id: {user_id} - email {email}.\nError: {e}"
)
traceback.print_stack()
traceback.print_exc()
WEEKLY_ANALYSIS_EXCEPTIONS_TOTAL.inc()
continue
weekly_analysis_team = None
Expand Down
2 changes: 1 addition & 1 deletion google_ads/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def get_users(day_of_week_created: Optional[str] = None) -> Any:
wasp_db_url = await get_wasp_db_url()
if day_of_week_created:
query = f"""SELECT * FROM "User"
WHERE TO_CHAR("createdAt", 'Day') = '{day_of_week_created}'""" # nosec: [B608]
WHERE TRIM(TO_CHAR("createdAt", 'Day')) = '{day_of_week_created}'""" # nosec: [B608]
else:
query = 'SELECT * from "User"'
async with get_db_connection(db_url=wasp_db_url) as db:
Expand Down

0 comments on commit 0e9d85d

Please sign in to comment.