mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 12:21:02 +01:00
Fix flaky person test (#2221)
* Fix flaky person test * Black Co-authored-by: Michael Matloka <dev@twixes.com>
This commit is contained in:
parent
1942729819
commit
820ac84039
@ -162,7 +162,10 @@ class PersonViewSet(viewsets.ModelViewSet):
|
||||
|
||||
people = self.get_queryset()
|
||||
people = (
|
||||
people.annotate(keys=JsonKeys("properties")).values("keys").annotate(count=Count("id")).order_by("-count")
|
||||
people.annotate(keys=JsonKeys("properties"))
|
||||
.values("keys")
|
||||
.annotate(count=Count("id"))
|
||||
.order_by("-count", "keys")
|
||||
)
|
||||
return [{"name": event["keys"], "count": event["count"]} for event in people]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user