Skip to content

Commit

Permalink
Update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush-se committed Sep 19, 2024
1 parent 9d4f583 commit b4b0ad6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/seer/anomaly_detection/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def save_alert(
timeseries: List[TimeSeriesPoint],
anomalies: TimeSeriesAnomalies,
anomaly_algo_data: dict,
task_flag: str,
):
return NotImplemented

Expand Down Expand Up @@ -145,6 +146,7 @@ def save_alert(
timeseries: List[TimeSeriesPoint],
anomalies: TimeSeriesAnomalies,
anomaly_algo_data: dict,
task_flag: str,
):
with Session() as session:
existing_records = (
Expand Down Expand Up @@ -183,6 +185,7 @@ def save_alert(
for i, point in enumerate(timeseries)
],
anomaly_algo_data=anomaly_algo_data,
task_flag=task_flag,
)
session.add(new_record)
session.commit()
Expand Down
2 changes: 2 additions & 0 deletions src/seer/anomaly_detection/anomaly_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def _online_detect(
Returns:
Tuple with input timeseries and identified anomalies
"""

logger.info(f"Detecting anomalies for alert ID: {alert.id}")
ts_external: List[TimeSeriesPoint] = []
if alert.cur_window:
Expand Down Expand Up @@ -296,6 +297,7 @@ def store_data(
timeseries=ts,
anomalies=anomalies,
anomaly_algo_data={"window_size": anomalies.window_size},
task_flag="not_queued",
)
return StoreDataResponse(success=True)

Expand Down

0 comments on commit b4b0ad6

Please sign in to comment.