Skip to content

Commit e4cf4de

Browse files
mrjefflewisJeff Lewishsheth2
authored
feat(ingest/mssql): improve docs on using odbc (datahub-project#10370)
Co-authored-by: Jeff Lewis <[email protected]> Co-authored-by: Harshal Sheth <[email protected]>
1 parent 6af0e8f commit e4cf4de

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

metadata-ingestion/setup.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@
233233
*pydantic_no_v2,
234234
}
235235

236+
mssql_common = {
237+
"sqlalchemy-pytds>=0.3",
238+
"pyOpenSSL",
239+
}
240+
236241
postgres_common = {
237242
"psycopg2-binary",
238243
"GeoAlchemy2",
@@ -371,12 +376,8 @@
371376
},
372377
"mode": {"requests", "tenacity>=8.0.1"} | sqllineage_lib | sqlglot_lib,
373378
"mongodb": {"pymongo[srv]>=3.11", "packaging"},
374-
"mssql": sql_common
375-
| {
376-
"sqlalchemy-pytds>=0.3",
377-
"pyOpenSSL",
378-
},
379-
"mssql-odbc": sql_common | {"pyodbc"},
379+
"mssql": sql_common | mssql_common,
380+
"mssql-odbc": sql_common | mssql_common | {"pyodbc"},
380381
"mysql": mysql,
381382
# mariadb should have same dependency as mysql
382383
"mariadb": sql_common | {"pymysql>=1.0.2"},

metadata-ingestion/src/datahub/ingestion/source/sql/mssql/source.py

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class SQLServerSource(SQLAlchemySource):
151151
- Column types associated with each table/view
152152
- Table, row, and column statistics via optional SQL profiling
153153
We have two options for the underlying library used to connect to SQL Server: (1) [python-tds](https://github.com/denisenkom/pytds) and (2) [pyodbc](https://github.com/mkleehammer/pyodbc). The TDS library is pure Python and hence easier to install.
154+
If you do use pyodbc, make sure to change the source type from `mssql` to `mssql-odbc` so that we pull in the right set of dependencies. This will be needed in most cases where encryption is required, such as managed SQL Server services in Azure.
154155
"""
155156

156157
def __init__(self, config: SQLServerConfig, ctx: PipelineContext):

0 commit comments

Comments
 (0)