From 6eefdb1b12763c34167fbe62fb231b8ad08cea61 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Thu, 29 Aug 2024 20:18:50 +0100 Subject: [PATCH] fix(data-warehouse): Try lowercase cursor path (#24673) --- .../data_imports/pipelines/sql_database/helpers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/posthog/temporal/data_imports/pipelines/sql_database/helpers.py b/posthog/temporal/data_imports/pipelines/sql_database/helpers.py index 653f93392466c..894407beda8a0 100644 --- a/posthog/temporal/data_imports/pipelines/sql_database/helpers.py +++ b/posthog/temporal/data_imports/pipelines/sql_database/helpers.py @@ -35,9 +35,12 @@ def __init__( try: self.cursor_column: Optional[Column[Any]] = table.c[incremental.cursor_path] except KeyError as e: - raise KeyError( - f"Cursor column '{incremental.cursor_path}' does not exist in table '{table.name}'" - ) from e + try: + self.cursor_column = table.c[incremental.cursor_path.lower()] + except KeyError: + raise KeyError( + f"Cursor column '{incremental.cursor_path}' does not exist in table '{table.name}'" + ) from e self.last_value = incremental.last_value else: self.cursor_column = None