diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py b/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py index 1624203c4096b..b3a5f134c61d6 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py @@ -713,18 +713,17 @@ def loop_tables( # noqa: C901 data_reader, ) except Exception as e: - self.warn( - logger, - f"{schema}.{table}", - f"Ingestion error: {e}", + self.report.warning( + "Error processing table", + context=f"{schema}.{table}", + exc=e, ) - logger.debug( - f"Error processing table {schema}.{table}: Error was: {e} Traceback:", - exc_info=e, - ) - except Exception as e: - self.error(logger, f"{schema}", f"Tables error: {e}") + self.report.failure( + "Error processing tables", + context=schema, + exc=e, + ) def add_information_for_schema(self, inspector: Inspector, schema: str) -> None: pass @@ -1047,13 +1046,17 @@ def loop_views( sql_config=sql_config, ) except Exception as e: - self.warn( - logger, - f"{schema}.{view}", - f"Ingestion error: {e} {traceback.format_exc()}", + self.report.warning( + "Error processing view", + context=f"{schema}.{view}", + exc=e, ) except Exception as e: - self.error(logger, f"{schema}", f"Views error: {e}") + self.report.failure( + "Error processing views", + context=schema, + exc=e, + ) def _process_view( self,