QTZPOC-20
QTZPOC-20: Remove redundant NOSONAR comments across multiple files.
This commit is contained in:
@@ -25,7 +25,7 @@ def build_mlflow_config() -> dict[str, Any]:
|
||||
'host': getenv('MLFLOW_HOST', 'http://localhost'),
|
||||
'port': int(getenv('MLFLOW_PORT', '5080')),
|
||||
'username': getenv('MLFLOW_USERNAME', 'aignosi'),
|
||||
'password': getenv('MLFLOW_PASSWORD', 'aignosi'), # NOSONAR
|
||||
'password': getenv('MLFLOW_PASSWORD', 'aignosi'),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ def summarize_failure(
|
||||
"""
|
||||
if exception is not None:
|
||||
cause = _root_cause(exception)
|
||||
return _type_name(cause), _one_line(str(cause)) # NOSONAR
|
||||
return _type_name(cause), _one_line(str(cause))
|
||||
return error_type or _UNKNOWN_ERROR_TYPE, _one_line(detail_text or '')
|
||||
|
||||
|
||||
@@ -361,8 +361,8 @@ def describe_failure_chain(exception: BaseException) -> tuple[str, str]:
|
||||
"""
|
||||
links: list[str] = []
|
||||
for candidate in walk_cause_chain(exception):
|
||||
kind = _type_name(candidate) # NOSONAR
|
||||
message = _one_line(str(candidate)) # NOSONAR
|
||||
kind = _type_name(candidate)
|
||||
message = _one_line(str(candidate))
|
||||
# `ApplicationError.__str__` already prefixes its own type, and `MlflowException:
|
||||
# MlflowException: …` reads like two failures rather than one.
|
||||
if not message:
|
||||
@@ -422,7 +422,7 @@ def failure_location(exception: BaseException | None) -> tuple[str | None, int |
|
||||
if exception is None:
|
||||
return None, None
|
||||
for candidate in walk_cause_chain(exception):
|
||||
details = getattr(candidate, 'details', None) # NOSONAR
|
||||
details = getattr(candidate, 'details', None)
|
||||
if details and isinstance(details[0], dict) and 'step' in details[0]:
|
||||
location = details[0]
|
||||
gate = location.get('gate')
|
||||
|
||||
@@ -1150,7 +1150,7 @@ class MLFlowRepository(SientiaMonitoring):
|
||||
prediction_data.index = input_index
|
||||
|
||||
# Merge prediction data with retrain_dataset on index
|
||||
prediction_data = pd.merge( # NOSONAR
|
||||
prediction_data = pd.merge(
|
||||
retrain_dataset, prediction_data, left_index=True, right_index=True, how='left'
|
||||
)
|
||||
|
||||
@@ -1275,7 +1275,7 @@ class MLFlowRepository(SientiaMonitoring):
|
||||
# Aligns data with treated data indexes to get target variable
|
||||
aligned_data = data.loc[treated_data.index]
|
||||
aligned_series = aligned_data[target_name]
|
||||
retrain_dataset = pd.merge( # NOSONAR
|
||||
retrain_dataset = pd.merge(
|
||||
treated_data, aligned_series, left_index=True, right_index=True
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -79,7 +79,7 @@ def _opc_authentication_token_str(client: Client | None) -> str:
|
||||
if tok is None:
|
||||
return 'unknown'
|
||||
return str(tok)
|
||||
except Exception: # NOSONAR - best-effort label for logs/metrics, must not fail loud
|
||||
except Exception: # best-effort label for logs/metrics, must not fail loud
|
||||
return 'unknown'
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ def _opc_status_from_exception(exc: BaseException) -> str:
|
||||
str: Status class name or generic Python exception name.
|
||||
"""
|
||||
for candidate in walk_cause_chain(exc):
|
||||
if isinstance(candidate, UaStatusCodeError): # NOSONAR
|
||||
return type(candidate).__name__ # NOSONAR
|
||||
if isinstance(candidate, UaStatusCodeError):
|
||||
return type(candidate).__name__
|
||||
return type(exc).__name__
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user