Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest): improve sql error reporting calls #11025

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading