From 1209af8995a0cf01aa93c16e2f5f685c96a85d96 Mon Sep 17 00:00:00 2001 From: Nickolas Grigoriadis Date: Fri, 12 Jul 2024 16:37:56 +0100 Subject: [PATCH 1/2] As a last resort, try inserting TEXT into a UUID column --- target_postgres/connector.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target_postgres/connector.py b/target_postgres/connector.py index 4a1e3a6a..a29fd856 100644 --- a/target_postgres/connector.py +++ b/target_postgres/connector.py @@ -557,6 +557,10 @@ def _adapt_column_type( # type: ignore[override] self.update_collation(compatible_sql_type, current_type_collation) if not self.allow_column_alter: + # As a last resort, try inserting TEXT into a UUID column + if str(current_type) == 'UUID' and str(sql_type) == 'TEXT': + return + msg = ( "Altering columns is not supported. Could not convert column " f"'{schema_name}.{table_name}.{column_name}' from '{current_type}' to " From ea24173de45346b1131809476c74b55a8daec822 Mon Sep 17 00:00:00 2001 From: Nickolas Grigoriadis Date: Fri, 12 Jul 2024 16:49:51 +0100 Subject: [PATCH 2/2] Satisfy ruff --- target_postgres/connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target_postgres/connector.py b/target_postgres/connector.py index a29fd856..c96895e9 100644 --- a/target_postgres/connector.py +++ b/target_postgres/connector.py @@ -558,7 +558,7 @@ def _adapt_column_type( # type: ignore[override] if not self.allow_column_alter: # As a last resort, try inserting TEXT into a UUID column - if str(current_type) == 'UUID' and str(sql_type) == 'TEXT': + if str(current_type) == "UUID" and str(sql_type) == "TEXT": return msg = (