Skip to content

Commit

Permalink
fix(ingest): improve sql error reporting calls (#11025)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Jul 31, 2024
1 parent 1955c05 commit e751189
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e751189

Please sign in to comment.