Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions ingestion/src/metadata/clients/domo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_chart_details(self, page_id) -> Optional[DomoChartDetails]:
)

except Exception as exc:
logger.warning(f"Error while getting details for Card {page_id} - {exc}")
logger.error(f"Error while getting details for Card {page_id} - {exc}")
logger.debug(traceback.format_exc())

return None
Expand All @@ -140,7 +140,7 @@ def get_pipelines(self):
response = self.client.get(path=WORKFLOW_URL, headers=HEADERS)
return response
except Exception as exc:
logger.warning(f"Error while getting pipelines - {exc}")
logger.error(f"Error while getting pipelines - {exc}")
logger.debug(traceback.format_exc())
return []

Expand All @@ -164,7 +164,7 @@ def test_list_cards(self) -> None:
self.client.get(path="content/v1/cards", headers=HEADERS)
except Exception as exc:
logger.debug(traceback.format_exc())
logger.warning(f"Error listing cards due to [{exc}]")
logger.error(f"Error listing cards due to [{exc}]")
raise exc


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.name} for {get_table_fqn(self.test_case.entityLink.root)}: {exc}"
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _run_validation(self) -> TestCaseResult:
except (ValueError, RuntimeError) as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _run_validation(self) -> TestCaseResult:
except Exception as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _run_validation(self) -> TestCaseResult:
except Exception as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _run_validation(self) -> TestCaseResult:
except Exception as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _run_validation(self) -> TestCaseResult:
except Exception as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _run_validation(self) -> TestCaseResult:
except Exception as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _run_validation(self) -> TestCaseResult:
except ValueError as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _run_validation(self) -> TestCaseResult:
except ValueError as exc:
msg = f"Error computing {self.test_case.fullyQualifiedName}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _run_validation(self) -> TestCaseResult:
except Exception as exc:
msg = f"Error computing {self.test_case.name}: {exc}" # type: ignore
logger.debug(traceback.format_exc())
logger.warning(msg)
logger.error(msg)
return self.get_test_case_result_object(
self.execution_date,
TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _run_validation(self):
)
return result
except UnsupportedDialectError as e:
logger.warning(f"[Data Diff]: Unsupported dialect: {e}")
logger.error(f"[Data Diff]: Unsupported dialect: {e}")
result = TestCaseResult(
timestamp=self.execution_date, # type: ignore
testCaseStatus=TestCaseStatus.Aborted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,6 @@ def close(self):
self.metadata.compute_percentile(Database, self.today)
except APIError as err:
logger.debug(traceback.format_exc())
logger.warning(f"Failed to publish compute.percentile: {err}")
logger.error(f"Failed to publish compute.percentile: {err}")

self.metadata.close()
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _test_connection_steps_automation_workflow(
)
except Exception as err:
logger.debug(traceback.format_exc())
logger.warning(f"{step.name}-{err}")
logger.error(f"{step.name}-{err}")
test_connection_result.steps.append(
TestConnectionStepResult(
name=step.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _parse_response(self, resp: dict, container_fqn: str) -> Optional[TableData]
return TableData(**resp["sampleData"])
except UnicodeError as err:
logger.debug(traceback.format_exc())
logger.warning(f"Cannot parse response from {container_fqn} due to {err}")
logger.error(f"Cannot parse response from {container_fqn} due to {err}")
return None

def ingest_container_sample_data(self, container: Container, sample_data: TableData) -> Optional[TableData]:
Expand Down
4 changes: 2 additions & 2 deletions ingestion/src/metadata/ingestion/source/api/rest/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def parse_openapi_schema(response: Response) -> Dict[str, Any]:
try:
return json.loads(content)
except json.JSONDecodeError as e:
logger.warning(f"Failed to parse as JSON despite content-type: {e}")
logger.error(f"Failed to parse as JSON despite content-type: {e}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Quality: Blanket warning→error promotion misclassifies non-critical failures

This PR promotes all logger.warning() calls to logger.error() without distinguishing between genuinely erroneous conditions and expected/graceful degradation scenarios. In many logging frameworks and monitoring setups, ERROR level triggers alerts and pages on-call engineers, while WARNING is for recoverable or expected-but-unusual situations.

Several of these changes are semantically incorrect:

  1. parse_openapi_schema (parser.py:57,62) — When JSON parsing fails here, the code falls through to a generic JSON→YAML fallback (lines 64-80). This is normal control flow, not an error. Logging at ERROR on a successful fallback path will generate false alarm noise.

  2. test_server_connection (connection.py:146) — This is a test function designed to return True/False. A failed connection is an expected outcome, not an error. (Also note the inconsistency: McpProtocolError is now error while the generic Exception on line 149 stays warning.)

  3. _test_connection_steps_automation_workflow (test_connections.py:138) — Test connection steps are expected to fail sometimes; the result is reported back to the user via TestConnectionStepResult. Logging each failure as ERROR is misleading.

  4. find_database_service_by_hostname / find_messaging_service_by_brokers (kafkaconnect/metadata.py:234,296) — These return None on failure and callers handle the absence gracefully. A missing service match is a warning, not an error.

  5. get_aws_bucket_region (s3/metadata.py:760) — Falls back to the configured region on line 761. This is graceful degradation.

Recommendation: Review each call site individually. Reserve logger.error() for conditions that indicate something is broken and needs attention (e.g., data corruption, unrecoverable API failures). Keep logger.warning() for expected-but-unusual situations where the code continues gracefully.

Suggested fix:

Audit each site individually. A helpful heuristic:
- ERROR: The operation failed AND the caller cannot recover
  (e.g., data loss, broken pipeline)
- WARNING: The operation failed BUT the code degrades
  gracefully (e.g., returns None, uses a fallback)
- DEBUG: Expected control-flow branches

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

elif "yaml" in content_type or "yml" in content_type:
try:
return yaml.safe_load(content)
except yaml.YAMLError as e:
logger.warning(f"Failed to parse as YAML despite content-type: {e}")
logger.error(f"Failed to parse as YAML despite content-type: {e}")

# If content-type is not definitive or parsing failed, try both formats

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_dashboards_list(self, collections: List[MetabaseCollection]) -> List[Met
dashboards.extend(dashboard_list.data)
except Exception:
logger.debug(traceback.format_exc())
logger.warning("Failed to fetch the dashboard list")
logger.error("Failed to fetch the dashboard list")
return dashboards

def get_dashboards_list_test_conn(self, collections: List[MetabaseCollection]) -> List[MetabaseDashboard]:
Expand Down Expand Up @@ -162,7 +162,7 @@ def get_collections_list(self) -> List[MetabaseCollection]:
return collection_list.collections
except Exception:
logger.debug(traceback.format_exc())
logger.warning("Failed to fetch the collections list")
logger.error("Failed to fetch the collections list")
return []

def get_charts_dict(self) -> Dict:
Expand All @@ -176,7 +176,7 @@ def get_charts_dict(self) -> Dict:
return charts_dict
except Exception as e:
logger.debug(traceback.format_exc())
logger.warning(f"Failed to fetch the cards : {e}")
logger.error(f"Failed to fetch the cards : {e}")
return {}

def _create_default_dashboard_details(self, orphan_charts_id: List) -> MetabaseDashboardDetails:
Expand Down Expand Up @@ -233,7 +233,7 @@ def get_dashboard_details(
return self._process_dashboard_response(resp_dashboard, charts_dict, dashboard_id)
except Exception:
logger.debug(traceback.format_exc())
logger.warning(f"Failed to fetch the dashboard with id: {dashboard_id}")
logger.error(f"Failed to fetch the dashboard with id: {dashboard_id}")
return None

def get_database(self, database_id: str) -> Optional[MetabaseDatabase]:
Expand All @@ -248,7 +248,7 @@ def get_database(self, database_id: str) -> Optional[MetabaseDatabase]:
return MetabaseDatabase(**resp_database)
except Exception:
logger.debug(traceback.format_exc())
logger.warning(f"Failed to fetch the database with id: {database_id}")
logger.error(f"Failed to fetch the database with id: {database_id}")
return None

def get_table(self, table_id: str) -> Optional[MetabaseTable]:
Expand All @@ -263,7 +263,7 @@ def get_table(self, table_id: str) -> Optional[MetabaseTable]:
return MetabaseTable(**resp_table)
except Exception:
logger.debug(traceback.format_exc())
logger.warning(f"Failed to fetch the table with id: {table_id}")
logger.error(f"Failed to fetch the table with id: {table_id}")
return None

def get_user_details(self, user_id: str) -> Optional[MetabaseUser]:
Expand All @@ -278,5 +278,5 @@ def get_user_details(self, user_id: str) -> Optional[MetabaseUser]:
return MetabaseUser(**resp_table)
except Exception:
logger.debug(traceback.format_exc())
logger.warning(f"Failed to fetch the user with id: {user_id}")
logger.error(f"Failed to fetch the user with id: {user_id}")
return None
Loading
Loading