feat(api): fixed search by metadata
feat(api): fixed search by number metadata
This commit is contained in:
parent
0b63bdf94d
commit
4669060120
3 changed files with 4 additions and 4 deletions
|
|
@ -245,7 +245,7 @@ class event_type:
|
|||
STATEACTION = Event(ui_type=schemas.EventType.state_action, table="events.state_actions", column="name")
|
||||
ERROR = Event(ui_type=schemas.EventType.error, table="events.errors",
|
||||
column=None) # column=None because errors are searched by name or message
|
||||
METADATA = Event(ui_type=schemas.EventType.metadata, table="public.sessions", column=None)
|
||||
METADATA = Event(ui_type=schemas.FilterType.metadata, table="public.sessions", column=None)
|
||||
# IOS
|
||||
CLICK_IOS = Event(ui_type=schemas.EventType.click_ios, table="events_ios.clicks", column="label")
|
||||
INPUT_IOS = Event(ui_type=schemas.EventType.input_ios, table="events_ios.inputs", column="label")
|
||||
|
|
|
|||
|
|
@ -401,10 +401,10 @@ def search_query_parts(data, error_status, errors_only, favorite_only, issue, pr
|
|||
# op = __get_sql_operator(f.operator)
|
||||
if f.source in meta_keys.keys():
|
||||
extra_constraints.append(
|
||||
_multiple_conditions(f"s.{metadata.index_to_colname(meta_keys[f.source])} {op} %({f_k})s",
|
||||
_multiple_conditions(f"s.{metadata.index_to_colname(meta_keys[f.source])} {op} %({f_k})s::text",
|
||||
f.value, is_not=is_not, value_key=f_k))
|
||||
ss_constraints.append(
|
||||
_multiple_conditions(f"ms.{metadata.index_to_colname(meta_keys[f.source])} {op} %({f_k})s",
|
||||
_multiple_conditions(f"ms.{metadata.index_to_colname(meta_keys[f.source])} {op} %({f_k})s::text",
|
||||
f.value, is_not=is_not, value_key=f_k))
|
||||
elif filter_type in [schemas.FilterType.user_id, schemas.FilterType.user_id_ios]:
|
||||
# op = __get_sql_operator(f.operator)
|
||||
|
|
|
|||
|
|
@ -371,7 +371,6 @@ class EventType(str, Enum):
|
|||
graphql = "GRAPHQL"
|
||||
state_action = "STATEACTION"
|
||||
error = "ERROR"
|
||||
metadata = "METADATA"
|
||||
click_ios = "CLICK_IOS"
|
||||
input_ios = "INPUT_IOS"
|
||||
view_ios = "VIEW_IOS"
|
||||
|
|
@ -566,6 +565,7 @@ class FlatSessionsSearchPayloadSchema(SessionsSearchPayloadSchema):
|
|||
if v.get("isEvent"):
|
||||
n_events.append(v)
|
||||
else:
|
||||
v["isEvent"] = False
|
||||
n_filters.append(v)
|
||||
values["events"] = n_events
|
||||
values["filters"] = n_filters
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue