Skip to content

Commit

Permalink
Tuple validation in OBJECT class
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gvenegascastro committed Dec 16, 2024
1 parent a171431 commit e1ca5aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/snowflake/sqlalchemy/custom_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down

0 comments on commit e1ca5aa

Please # to comment.