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

Exception fix #236

Merged
merged 1 commit into from
Jul 28, 2023
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
10 changes: 10 additions & 0 deletions udf/anomaly-detection/src/udf/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ def inference(
)
return static_response

except Exception as ex:
_LOGGER.exception(
"%s - Unhandled exception while fetching inference artifact, Keys: %s, Metric: %s, Error: %r",
payload.uuid,
payload.composite_keys,
payload.metrics,
ex,
)
return static_response

# Check if artifact is found
if not artifact_data:
_LOGGER.info(
Expand Down
10 changes: 10 additions & 0 deletions udf/anomaly-detection/src/udf/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ def preprocess(self, keys: List[str], payload: StreamPayload) -> (np.ndarray, St
)
return None, Status.RUNTIME_ERROR

except Exception as ex:
_LOGGER.exception(
"%s - Unhandled exception while fetching preproc artifact, Keys: %s, Metric: %s, Error: %r",
payload.uuid,
payload.composite_keys,
payload.metrics,
ex,
)
return None, Status.RUNTIME_ERROR

# Check if artifact is found
if not preproc_artifact:
_LOGGER.info(
Expand Down
11 changes: 11 additions & 0 deletions udf/anomaly-detection/src/udf/threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ def threshold(
static_scores = calculate_static_thresh(metric_arr, static_thresh)
return static_scores, Status.RUNTIME_ERROR, Header.STATIC_INFERENCE, -1

except Exception as ex:
_LOGGER.exception(
"%s - Unhandled exception while fetching threshold artifact, Keys: %s, Metric: %s, Error: %r",
payload.uuid,
payload.composite_keys,
payload.metrics,
ex,
)
static_scores = calculate_static_thresh(metric_arr, static_thresh)
return static_scores, Status.RUNTIME_ERROR, Header.STATIC_INFERENCE, -1

# Check if artifact is found
if not thresh_artifact:
_LOGGER.info(
Expand Down
Loading