Skip to content

Commit 13d148e

Browse files
Update to_sql_type
1 parent 4fd6d10 commit 13d148e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: target_snowflake/connector.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,7 @@ def _conform_max_length(jsonschema_type): # noqa: ANN205, ANN001
317317
jsonschema_type["maxLength"] = SNOWFLAKE_MAX_STRING_LENGTH
318318
return jsonschema_type
319319

320-
@staticmethod
321-
def to_sql_type(jsonschema_type: dict) -> sqlalchemy.types.TypeEngine:
320+
def to_sql_type(self, jsonschema_type: dict) -> sqlalchemy.types.TypeEngine:
322321
"""Return a JSON Schema representation of the provided type.
323322
324323
Uses custom Snowflake types from [snowflake-sqlalchemy](https://github.com/snowflakedb/snowflake-sqlalchemy/blob/main/src/snowflake/sqlalchemy/custom_types.py)
@@ -331,7 +330,7 @@ def to_sql_type(jsonschema_type: dict) -> sqlalchemy.types.TypeEngine:
331330
"""
332331
# start with default implementation
333332
jsonschema_type = SnowflakeConnector._conform_max_length(jsonschema_type)
334-
target_type = SQLConnector.to_sql_type(jsonschema_type)
333+
target_type = super().to_sql_type(jsonschema_type)
335334
# snowflake max and default varchar length
336335
# https://docs.snowflake.com/en/sql-reference/intro-summary-data-types.html
337336
maxlength = jsonschema_type.get("maxLength", SNOWFLAKE_MAX_STRING_LENGTH)

0 commit comments

Comments
 (0)