From 9c6647abdf6428a7a81337f28b8b0b1ee66f2b35 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 21 Dec 2023 13:24:50 -0500 Subject: [PATCH] typing --- posthog/tasks/warehouse.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/posthog/tasks/warehouse.py b/posthog/tasks/warehouse.py index d01997af62ba4..29e0804d4c428 100644 --- a/posthog/tasks/warehouse.py +++ b/posthog/tasks/warehouse.py @@ -183,9 +183,13 @@ def check_synced_row_limits() -> None: @app.task(ignore_result=True) def check_synced_row_limits_of_team(team_id: int) -> None: start_of_month = datetime.datetime.now().replace(day=1, hour=0, minute=0, second=0, microsecond=0) - rows_synced_list: list[int] = ExternalDataJob.objects.filter( - team_id=team_id, created_at__gte=start_of_month - ).values_list("rows_synced", flat=True) + rows_synced_list = [ + x + for x in ExternalDataJob.objects.filter(team_id=team_id, created_at__gte=start_of_month).values_list( + "rows_synced", flat=True + ) + if x + ] total_rows_synced = sum(rows_synced_list) if total_rows_synced > MONTHLY_LIMIT: