Skip to content

Commit

Permalink
safely check warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 committed Nov 10, 2022
1 parent ae4825d commit c969105
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion metadata-ingestion/src/datahub/ingestion/source/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def get_connection_object_page(

if "errors" in query_data:
errors = query_data["errors"]
if all(error["extensions"]["severity"] == "WARNING" for error in errors):
if all(
error.get("extensions", {}).get("severity", None) == "WARNING"
for error in errors
):
self.report.report_warning(key=connection_type, reason=f"{errors}")
else:
raise RuntimeError(f"Query {connection_type} error: {errors}")
Expand Down

0 comments on commit c969105

Please sign in to comment.