From c72938085d458af204dfa3c25d25bc3fa6cd5a69 Mon Sep 17 00:00:00 2001 From: NiharDoshi99 <51595473+NiharDoshi99@users.noreply.github.com> Date: Tue, 20 Dec 2022 20:44:57 +0530 Subject: [PATCH] Fix:minor changes in atlas (#9418) --- .../ingestion/source/metadata/atlas.py | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/metadata/atlas.py b/ingestion/src/metadata/ingestion/source/metadata/atlas.py index 10618676f9f..7407d2555d9 100644 --- a/ingestion/src/metadata/ingestion/source/metadata/atlas.py +++ b/ingestion/src/metadata/ingestion/source/metadata/atlas.py @@ -266,30 +266,33 @@ class AtlasSource(Source): entity=Table, fqn=table_fqn ) - if tbl_attrs.get("description", None) and table_object: - self.metadata.patch_description( - entity_id=table_object.id, - entity=Table, - description=tbl_attrs["description"], - force=True, + if table_object: + if tbl_attrs.get("description", None): + self.metadata.patch_description( + entity_id=table_object.id, + entity=Table, + description=tbl_attrs["description"], + force=True, + ) + + tag_fqn = fqn.build( + self.metadata, + entity_type=Tag, + tag_category_name=ATLAS_TAG_CATEGORY, + tag_name=ATLAS_TABLE_TAG, ) - tag_fqn = fqn.build( - self.metadata, - entity_type=Tag, - tag_category_name=ATLAS_TAG_CATEGORY, - tag_name=ATLAS_TABLE_TAG, - ) - - self.metadata.patch_tag( - entity=Table, entity_id=table_object.id, tag_fqn=tag_fqn - ) + self.metadata.patch_tag( + entity=Table, entity_id=table_object.id, tag_fqn=tag_fqn + ) yield from self.ingest_lineage(tbl_entity["guid"], name) except Exception as exc: logger.debug(traceback.format_exc()) - logger.warning(f"Failed to parse {table_entity}: {exc}") + logger.warning( + f"Failed to parse for database : {db_entity} - table {table}: {exc}" + ) def get_tags(self): tags = [