From f423ce7148e02f17be24881f66a43654ba3649b2 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Mon, 3 Mar 2025 16:41:53 +0100 Subject: [PATCH] Avoid division by 1 errors --- posthog/temporal/data_imports/pipelines/postgres/postgres.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/temporal/data_imports/pipelines/postgres/postgres.py b/posthog/temporal/data_imports/pipelines/postgres/postgres.py index 343e69f89a98c..57df1a7532715 100644 --- a/posthog/temporal/data_imports/pipelines/postgres/postgres.py +++ b/posthog/temporal/data_imports/pipelines/postgres/postgres.py @@ -99,7 +99,7 @@ def _get_table_chunk_size(cursor: psycopg.Cursor, schema: str, table_name: str, logger.debug(f"_get_table_chunk_size: No results returned. Using DEFAULT_CHUNK_SIZE={DEFAULT_CHUNK_SIZE}") return DEFAULT_CHUNK_SIZE - row_size_bytes = row[0] + row_size_bytes = row[0] or 1 chunk_size = int(DEFAULT_TABLE_SIZE_BYTES / row_size_bytes)