From 1ffd24131ee40ef4eedb4032828f82ba6a90215c Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Tue, 15 Nov 2022 23:11:57 -0500 Subject: [PATCH] chore(ingest): fix mssql lint (#6453) --- .../src/datahub/ingestion/source/sql/mssql.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/mssql.py b/metadata-ingestion/src/datahub/ingestion/source/sql/mssql.py index 9234d786ea..1c8af307f5 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/mssql.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/mssql.py @@ -136,13 +136,16 @@ class SQLServerSource(SQLAlchemySource): @staticmethod def _add_output_converters(conn: Connection) -> None: def handle_sql_variant_as_string(value): - return value.decode('utf-16le') + return value.decode("utf-16le") + # see https://stackoverflow.com/questions/45677374/pandas-pyodbc-odbc-sql-type-150-is-not-yet-supported # and https://stackoverflow.com/questions/11671170/adding-output-converter-to-pyodbc-connection-in-sqlalchemy try: conn.connection.add_output_converter(-150, handle_sql_variant_as_string) except AttributeError as e: - logger.debug(f"Failed to mount output converter for MSSQL data type -150 due to {e}") + logger.debug( + f"Failed to mount output converter for MSSQL data type -150 due to {e}" + ) def _populate_table_descriptions(self, conn: Connection, db_name: str) -> None: # see https://stackoverflow.com/questions/5953330/how-do-i-map-the-id-in-sys-extended-properties-to-an-object-name