feat(api): fixed search TIME_BETWEEN_EVENTS

feat(api): added = to MathOperator
This commit is contained in:
Taha Yassine Kraiem 2021-12-29 17:37:55 +01:00
parent 4209b5b1b9
commit 66ce43ea08
2 changed files with 3 additions and 3 deletions

View file

@ -505,8 +505,8 @@ def search2_pg(data: schemas.SessionsSearchPayloadSchema, project_id, user_id, f
event.value[0].value = [event.value[0].value]
if not isinstance(event.value[1].value, list):
event.value[1].value = [event.value[1].value]
event.value[0].value = helper.values_for_operator(value=event.value[0].value, op=event.operator)
event.value[1].value = helper.values_for_operator(value=event.value[1].value, op=event.operator)
event.value[0].value = helper.values_for_operator(value=event.value[0].value, op=event.value[0].operator)
event.value[1].value = helper.values_for_operator(value=event.value[1].value, op=event.value[0].operator)
e_k1 = e_k + "_e1"
e_k2 = e_k + "_e2"
full_args = {**full_args,
@ -534,7 +534,6 @@ def search2_pg(data: schemas.SessionsSearchPayloadSchema, project_id, user_id, f
else:
print("LLLLLLLLLLLLLL")
continue
if event_index == 0 or or_events:
event_where += ss_constraints

View file

@ -313,6 +313,7 @@ class AlertColumn(str, Enum):
class MathOperator(str, Enum):
_equal = "="
_less = "<"
_greater = ">"
_less_eq = "<="