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
Sessions filtering postgres support #2728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Endpoint swap lgtm. There's a few considerations where we could move the parameter processing/defaults into the dedicated filter but minor for the time being
if not filter._date_from: | ||
filter._date_from = relative_date_parse("-7d") | ||
if not filter._date_to: | ||
filter._date_to = timezone.now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move this into SessionFilter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but the annoying part is this requires refactoring python sessions list as well which has subtly different code. Hope it's fine I'll leave it like this for now.
@@ -43,27 +38,9 @@ def trend(self, request: Request, *args: Any, **kwargs: Any) -> Response: | |||
|
|||
@action(methods=["GET"], detail=False) | |||
def session(self, request: Request, *args: Any, **kwargs: Any) -> Response: | |||
response = ClickhouseSessions().run(team=self.team, filter=Filter(request=request)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This split feels much better haha. There were too many conflicting functions here
4eed4cd
to
29cd653
Compare
Changes
After this:
I did not put the offset handling code into this query as it would have become quite expensive. Will handle that in a separate PR.
Checklist