Skip to content

Commit

Permalink
fix: fixed alerts for retrocompatibility (#189)
Browse files Browse the repository at this point in the history
* fix: fixed alerts for retrocompatibility

* fix: fixed percentages for retrocompatibility

* fix: update init_db.sql with update if conflict on UUID

* fix: fixed init_db sql on init-data

---------

Co-authored-by: dvalleri <[email protected]>
  • Loading branch information
SteZamboni and dvalleri authored Oct 30, 2024
1 parent f36fa4a commit d83d8d2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 17 deletions.
4 changes: 2 additions & 2 deletions api/app/services/model_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_summarized_percentages(self) -> TotPercentagesDTO:
mq, mq_c = 0, 0
dr, dr_c = 0, 0
for _, metrics in models:
if metrics:
if metrics and metrics.percentages:
dq = dq + (
metrics.percentages['data_quality']['value']
if metrics.percentages['data_quality']['value'] >= 0
Expand Down Expand Up @@ -137,7 +137,7 @@ def get_last_n_alerts(self, n_alerts) -> List[AlertDTO]:
latest_reference_dataset, latest_current_dataset = self.get_latest_datasets(
model.uuid
)
if metrics:
if metrics and metrics.percentages:
for perc in ['data_quality', 'model_quality', 'drift']:
if count_alerts == n_alerts:
return res
Expand Down
67 changes: 52 additions & 15 deletions init-data/init_db.sql

Large diffs are not rendered by default.

0 comments on commit d83d8d2

Please sign in to comment.