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

Fix weekly analysis #790

Merged
merged 1 commit into from
Jun 25, 2024
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
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