From c9f665828cf0bdc3cc77a41058094b30f6534fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Thu, 19 Oct 2023 23:34:41 +0200 Subject: [PATCH] fix(backfill-batch-exports): Do not run partial ranges --- posthog/temporal/workflows/backfill_batch_export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posthog/temporal/workflows/backfill_batch_export.py b/posthog/temporal/workflows/backfill_batch_export.py index 10cc2d31d42ed..24b00c81876ab 100644 --- a/posthog/temporal/workflows/backfill_batch_export.py +++ b/posthog/temporal/workflows/backfill_batch_export.py @@ -244,7 +244,9 @@ def backfill_range( current_end = current + step if current_end > end_at: - current_end = end_at + # Do not yield a range that is less than step. + # Same as built-in range. + break yield current, current_end