diff --git a/dlt/destinations/impl/mssql/factory.py b/dlt/destinations/impl/mssql/factory.py index adfbb5b79a..2ea996c856 100644 --- a/dlt/destinations/impl/mssql/factory.py +++ b/dlt/destinations/impl/mssql/factory.py @@ -42,6 +42,7 @@ class MsSqlTypeMapper(TypeMapperImpl): dbt_to_sct = { "nvarchar": "text", + "varchar": "text", "float": "double", "bit": "bool", "datetimeoffset": "timestamp", diff --git a/tests/load/mssql/test_type_mapper.py b/tests/load/mssql/test_type_mapper.py new file mode 100644 index 0000000000..99a49a6876 --- /dev/null +++ b/tests/load/mssql/test_type_mapper.py @@ -0,0 +1,9 @@ +from dlt.destinations import mssql + + +def test_from_destination_type_mssql_text_types() -> None: + caps = mssql().capabilities() + mapper = caps.get_type_mapper() + + assert mapper.from_destination_type("nvarchar", None, None) == {"data_type": "text"} + assert mapper.from_destination_type("varchar", None, None) == {"data_type": "text"} \ No newline at end of file