From f4c0927d11658a08a01c35aca823a9d5abd09f5f Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 23 Jan 2025 18:21:08 +0530 Subject: [PATCH] fix(ingest/glue): add try catch (#12449) --- .../src/datahub/ingestion/source/aws/glue.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py b/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py index 2509927854d4a..2ace71b6ff6c1 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py +++ b/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py @@ -738,11 +738,17 @@ def get_all_databases_and_tables( self, ) -> Tuple[List[Mapping[str, Any]], List[Dict]]: all_databases = [*self.get_all_databases()] - all_tables = [ - tables - for database in all_databases - for tables in self.get_tables_from_database(database) - ] + all_tables = [] + for database in all_databases: + try: + for tables in self.get_tables_from_database(database): + all_tables.append(tables) + except Exception as e: + self.report.failure( + message="Failed to get tables from database", + context=database["Name"], + exc=e, + ) return all_databases, all_tables def get_lineage_if_enabled(