From e62f82abad36c7d15f05daebfe334c83057d1094 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Thu, 5 Dec 2024 14:06:32 +0000 Subject: [PATCH] fix(data-warehouse): Add support for sql arrays (#26633) --- .../pipelines/sql_database_v2/schema_types.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/posthog/temporal/data_imports/pipelines/sql_database_v2/schema_types.py b/posthog/temporal/data_imports/pipelines/sql_database_v2/schema_types.py index cc744eed0c9f6..6f6e883b3dc0d 100644 --- a/posthog/temporal/data_imports/pipelines/sql_database_v2/schema_types.py +++ b/posthog/temporal/data_imports/pipelines/sql_database_v2/schema_types.py @@ -123,11 +123,16 @@ def sqla_col_to_column_schema( col["data_type"] = "date" elif isinstance(sql_t, sqltypes.Time): col["data_type"] = "time" - elif isinstance(sql_t, sqltypes.JSON) or isinstance(sql_t, BigQueryJSON) or isinstance(sql_t, BigQueryStruct): + elif ( + isinstance(sql_t, sqltypes.JSON) + or isinstance(sql_t, BigQueryJSON) + or isinstance(sql_t, BigQueryStruct) + or isinstance(sql_t, ARRAY) + ): col["data_type"] = "json" elif isinstance(sql_t, sqltypes.Boolean): col["data_type"] = "bool" - elif isinstance(sql_t, sqltypes.Interval) or isinstance(sql_t, INTERVAL) or isinstance(sql_t, ARRAY): + elif isinstance(sql_t, sqltypes.Interval) or isinstance(sql_t, INTERVAL): # No support for interval columns yet - we filter out binary columns, so reusing the DLT type for interval columns to be removed col["data_type"] = "interval" # type: ignore else: