diff --git a/tests/core/test_connector_sql.py b/tests/core/test_connector_sql.py index f589478ab..c15a0c2ed 100644 --- a/tests/core/test_connector_sql.py +++ b/tests/core/test_connector_sql.py @@ -476,7 +476,7 @@ def my_type_to_jsonschema(self, column_type) -> dict: # noqa: ARG002 assert m.to_jsonschema(sa.types.BOOLEAN()) == {"type": ["boolean"]} -class TestJSONSchemaToSQL: +class TestJSONSchemaToSQL: # noqa: PLR0904 @pytest.fixture def json_schema_to_sql(self) -> JSONSchemaToSQL: return JSONSchemaToSQL() @@ -580,13 +580,23 @@ def test_anyof_datetime(self, json_schema_to_sql: JSONSchemaToSQL): def test_anyof_integer(self, json_schema_to_sql: JSONSchemaToSQL): jsonschema_type = { "anyOf": [ - {"type": "integer"}, {"type": "null"}, + {"type": "integer"}, ], } result = json_schema_to_sql.to_sql_type(jsonschema_type) assert isinstance(result, sa.types.INTEGER) + def test_anyof_unknown(self, json_schema_to_sql: JSONSchemaToSQL): + jsonschema_type = { + "anyOf": [ + {"type": "null"}, + {"type": "unknown"}, + ], + } + result = json_schema_to_sql.to_sql_type(jsonschema_type) + assert isinstance(result, sa.types.VARCHAR) + @pytest.mark.parametrize( "jsonschema_type,expected_type", [