From a2c68f6901650ec4988dbc65af5f93449233c74d Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Wed, 22 May 2024 14:13:01 +0530 Subject: [PATCH] MINOR: Fix UC missing table type (#16376) --- .../source/database/unitycatalog/metadata.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/unitycatalog/metadata.py b/ingestion/src/metadata/ingestion/source/database/unitycatalog/metadata.py index cc01b930203..74adbfa7143 100644 --- a/ingestion/src/metadata/ingestion/source/database/unitycatalog/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/unitycatalog/metadata.py @@ -267,17 +267,21 @@ class UnitycatalogSource( ) continue table_type: TableType = TableType.Regular - if table.table_type.value.lower() == TableType.View.value.lower(): - table_type: TableType = TableType.View - if table.table_type.value.lower() == TableType.External.value.lower(): - table_type: TableType = TableType.External + if table.table_type: + if table.table_type.value.lower() == TableType.View.value.lower(): + table_type: TableType = TableType.View + elif ( + table.table_type.value.lower() + == TableType.External.value.lower() + ): + table_type: TableType = TableType.External self.context.get().table_data = table yield table_name, table_type except Exception as exc: self.status.failed( StackTraceError( - name=table.Name, - error=f"Unexpected exception to get table [{table.Name}]: {exc}", + name=table.name, + error=f"Unexpected exception to get table [{table.name}]: {exc}", stackTrace=traceback.format_exc(), ) )