Skip to content

Commit

Permalink
rename latest to start_time
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Sep 5, 2024
1 parent e5f62bb commit 635ef6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export interface RecordingsQuery extends DataNode<RecordingsQueryResponse> {
person_uuid?: string
order:
| DurationType
| 'latest'
| 'start_time'
| 'console_error_count'
| 'click_count'
| 'keypress_count'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ def _select(self) -> list[ast.Expr]:
]

def _order_by_clause(self) -> ast.OrderExpr:
field = "start_time" if self._filter.order == "latest" else self._filter.order
expr = (
ast.Call(name="sipHash64", args=[ast.Field(chain=["session_id"])])
if self._filter.order == "random_sample"
else ast.Field(chain=[field])
else ast.Field(chain=[self._filter.order])
)
return ast.OrderExpr(expr=expr, order="DESC")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3778,7 +3778,7 @@ def test_ordering(self):
)

# ensures conversion to start_time
(session_recordings, _, _) = self._filter_recordings_by({"order": "latest"})
(session_recordings, _, _) = self._filter_recordings_by({"order": "start_time"})
assert [r["session_id"] for r in session_recordings] == [session_id_three, session_id_one, session_id_two]

(session_recordings, _, _) = self._filter_recordings_by({"order": "mouse_activity_count"})
Expand Down

0 comments on commit 635ef6f

Please sign in to comment.