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

[Alerts] fix event processing when criteria is defined #5929

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

Yacouby
Copy link
Member

@Yacouby Yacouby commented Jul 9, 2024

Copy link
Member

@alonmr alonmr left a comment

Choose a reason for hiding this comment

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

Looks good minor suggestions

Comment on lines 169 to 173

if state_obj is None:
state_obj = {"events": [event_data.timestamp]}
else:
state_obj["events"].append(event_data.timestamp)
Copy link
Member

Choose a reason for hiding this comment

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

Can be improved a bit

Suggested change
if state_obj is None:
state_obj = {"events": [event_data.timestamp]}
else:
state_obj["events"].append(event_data.timestamp)
state_obj = self._states.get(alert.id, None) or {}
state_obj.setdefault("events", [])
state_obj["events"].append(event_data.timestamp)

server/api/api/endpoints/events.py Show resolved Hide resolved
@alonmr alonmr merged commit c553efa into mlrun:development Jul 9, 2024
11 checks passed
@Yacouby Yacouby deleted the ML-6829 branch July 9, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants