From c6506f2bc7bcd8f9964f2bd12a7ee59c5f1d965c Mon Sep 17 00:00:00 2001 From: Dmytro Yurchuk Date: Mon, 22 Jul 2024 01:13:59 +0300 Subject: [PATCH] fix mypy errors --- .../src/datahub/ingestion/source/sql/mssql/source.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/mssql/source.py b/metadata-ingestion/src/datahub/ingestion/source/sql/mssql/source.py index 5ca83cb030bf4f..0599443f99954d 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/mssql/source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/mssql/source.py @@ -172,7 +172,7 @@ def __init__(self, config: SQLServerConfig, ctx: PipelineContext): self.current_database = None self.table_descriptions: Dict[str, str] = {} self.column_descriptions: Dict[str, str] = {} - self.full_lineage: Dict[str, Dict[str, List[Dict[str, str]]]] = {} + self.full_lineage: Dict[str, List[Dict[str, str]]] = {} self.procedures_dependencies: Dict[str, List[Dict[str, str | int]]] = {} if self.config.include_descriptions: for inspector in self.get_inspectors(): @@ -274,9 +274,9 @@ def get_ucs(self, inspector: Inspector, key: str) -> List[UpstreamClass]: if not self.config.mssql_lineage: return [] result = [] - for dest in self.full_lineage.get(key, {}): + for dest in self.full_lineage.get(key, []): dest_name = self.get_identifier( - schema=dest.get("schema"), entity=dest.get("name"), inspector=inspector # type: ignore[attr-defined] + schema=dest.get("schema", ""), entity=dest.get("name", ""), inspector=inspector ) dest_urn = make_dataset_urn_with_platform_instance( self.platform, @@ -597,7 +597,7 @@ def _populate_object_links(self, conn: Connection, db_name: str) -> None: # {"U ": "USER_TABLE", "V ": "VIEW", "P ": "SQL_STORED_PROCEDURE"} for row in _links: _key = f"{db_name}.{row['dst_schema_name']}.{row['dst_object_name']}" - self.full_lineage.setdefault(_key, []).append( # type: ignore[attr-defined, arg-type] + self.full_lineage.setdefault(_key, []).append( { "schema": row["src_schema_name"] or row["dst_schema_name"], "name": row["src_object_name"],