Skip to content

Commit

Permalink
Prioritize object and array
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Oct 18, 2024
1 parent 170c0e2 commit 1aa3b3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions singer_sdk/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,12 @@ def to_sql_type( # noqa: PLR0911, C901
Returns:
The SQL type.
"""
if _jsonschema_type_check(jsonschema_type, ("object",)):
return sa.types.VARCHAR()

if _jsonschema_type_check(jsonschema_type, ("array",)):
return sa.types.VARCHAR()

if _jsonschema_type_check(jsonschema_type, ("string",)):
datelike_type = get_datelike_property_type(jsonschema_type)
if datelike_type:
Expand All @@ -1236,10 +1242,4 @@ def to_sql_type( # noqa: PLR0911, C901
if _jsonschema_type_check(jsonschema_type, ("boolean",)):
return sa.types.BOOLEAN()

if _jsonschema_type_check(jsonschema_type, ("object",)):
return sa.types.VARCHAR()

if _jsonschema_type_check(jsonschema_type, ("array",)):
return sa.types.VARCHAR()

return sa.types.VARCHAR()

0 comments on commit 1aa3b3c

Please sign in to comment.