Skip to content

Commit

Permalink
feat(ingest): mssql - add type mappings for BIT and SQL_VARIANT (data…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and hungnp5 committed Nov 8, 2022
1 parent 2533572 commit 662d989
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/source/sql/mssql.py
Expand Up @@ -3,6 +3,7 @@
from typing import Any, Dict, Iterable, List, Optional, Tuple

import pydantic
import sqlalchemy.dialects.mssql

# This import verifies that the dependencies are available.
import sqlalchemy_pytds # noqa: F401
Expand All @@ -26,10 +27,15 @@
BasicSQLAlchemyConfig,
SQLAlchemySource,
make_sqlalchemy_uri,
register_custom_type,
)
from datahub.metadata.schema_classes import BooleanTypeClass, UnionTypeClass

logger: logging.Logger = logging.getLogger(__name__)

register_custom_type(sqlalchemy.dialects.mssql.BIT, BooleanTypeClass)
register_custom_type(sqlalchemy.dialects.mssql.SQL_VARIANT, UnionTypeClass)


class SQLServerConfig(BasicSQLAlchemyConfig):
# defaults
Expand Down

0 comments on commit 662d989

Please sign in to comment.