From e1ca5aaf4dff44ea96182a665831a47a9944f450 Mon Sep 17 00:00:00 2001 From: Gabriel Venegas Date: Mon, 16 Dec 2024 07:44:01 -0600 Subject: [PATCH] Tuple validation in OBJECT class --- src/snowflake/sqlalchemy/custom_types.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/snowflake/sqlalchemy/custom_types.py b/src/snowflake/sqlalchemy/custom_types.py index 3b6f93b8..ce7ad592 100644 --- a/src/snowflake/sqlalchemy/custom_types.py +++ b/src/snowflake/sqlalchemy/custom_types.py @@ -63,6 +63,10 @@ class OBJECT(StructuredType): __visit_name__ = "OBJECT" def __init__(self, **items_types: Union[TypeEngine, Tuple[TypeEngine, bool]]): + for key, value in items_types.items(): + if not isinstance(value, tuple): + items_types[key] = (value, False) + self.items_types = items_types self.is_semi_structured = len(items_types) == 0 super().__init__()