Skip to content

Commit

Permalink
feat(chalice): table of referrers&requests by users count
Browse files Browse the repository at this point in the history
  • Loading branch information
tahayk committed Aug 14, 2024
1 parent 2e037f2 commit cfa5caa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/schemas/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,8 @@ def __transform(self):
def __validator(self):
if self.metric_of not in (MetricOfTable.ISSUES, MetricOfTable.USER_BROWSER,
MetricOfTable.USER_DEVICE, MetricOfTable.USER_COUNTRY,
MetricOfTable.VISITED_URL):
MetricOfTable.VISITED_URL, MetricOfTable.REFERRER,
MetricOfTable.FETCH):
assert self.metric_format == MetricExtendedFormatType.SESSION_COUNT, \
f'metricFormat:{MetricExtendedFormatType.USER_COUNT.value} is not supported for this metricOf'
return self
Expand Down
3 changes: 1 addition & 2 deletions ee/api/chalicelib/core/sessions_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de
main_query = f"""SELECT COUNT(DISTINCT {main_col}) OVER () AS main_count,
{main_col} AS name,
count(DISTINCT user_id) AS user_count
FROM (SELECT s.user_id AS user_id,
{extra_col}
FROM (SELECT s.user_id AS user_id {extra_col}
{query_part}
WHERE isNotNull(user_id)
AND user_id != '') AS filtred_sessions
Expand Down

0 comments on commit cfa5caa

Please sign in to comment.