From 7ea6fe4b00c2419cc153c75744b0d4fab84264bf Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 25 Apr 2024 19:15:14 -0400 Subject: [PATCH 1/2] sync from start of month --- .../data_imports/workflow_activities/import_data.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posthog/temporal/data_imports/workflow_activities/import_data.py b/posthog/temporal/data_imports/workflow_activities/import_data.py index b6806071e721e..9f5187f173b97 100644 --- a/posthog/temporal/data_imports/workflow_activities/import_data.py +++ b/posthog/temporal/data_imports/workflow_activities/import_data.py @@ -67,9 +67,9 @@ async def import_data_activity(inputs: ImportDataActivityInputs) -> tuple[TSchem # Hacky just for specific user region = get_instance_region() if region == "EU" and inputs.team_id == 11870: - prev_day = timezone.now() - dt.timedelta(days=1) - start_date = prev_day.replace(hour=0, minute=0, second=0, microsecond=0) - end_date = start_date + dt.timedelta(1) + prev_day = timezone.now() + start_date = prev_day.replace(day=1, hour=0, minute=0, second=0, microsecond=0) + end_date = start_date + dt.timedelta(weeks=5) else: start_date = None end_date = None From a25eb4c91121b79fee054461fddbc2b1d92727fd Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 25 Apr 2024 19:16:49 -0400 Subject: [PATCH 2/2] condense --- .../temporal/data_imports/workflow_activities/import_data.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/posthog/temporal/data_imports/workflow_activities/import_data.py b/posthog/temporal/data_imports/workflow_activities/import_data.py index 9f5187f173b97..5da7e1fc1b109 100644 --- a/posthog/temporal/data_imports/workflow_activities/import_data.py +++ b/posthog/temporal/data_imports/workflow_activities/import_data.py @@ -67,8 +67,7 @@ async def import_data_activity(inputs: ImportDataActivityInputs) -> tuple[TSchem # Hacky just for specific user region = get_instance_region() if region == "EU" and inputs.team_id == 11870: - prev_day = timezone.now() - start_date = prev_day.replace(day=1, hour=0, minute=0, second=0, microsecond=0) + start_date = timezone.now().replace(day=1, hour=0, minute=0, second=0, microsecond=0) end_date = start_date + dt.timedelta(weeks=5) else: start_date = None