Skip to content

Commit

Permalink
Merge pull request #40 from simonsobs/dev
Browse files Browse the repository at this point in the history
Sort runs in the reverse order in the query runs
  • Loading branch information
TaiSakuma authored Feb 14, 2024
2 parents abe2a4e + f7d75a8 commit 8a26196
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/nextline_rdb/schema/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def query_connection_run(
first: Optional[int] = None,
last: Optional[int] = None,
) -> Connection[RunHistory]:
sort = [SortField('run_no')]
sort = [SortField('run_no', desc=True)]
Model = db_models.Run
NodeType = RunHistory
return await query_connection(
Expand Down
6 changes: 3 additions & 3 deletions tests/schema/queries/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def test_all(runs: list[Run]):

nodes = [edge['node'] for edge in edges]

assert nodes == nodes_saved
assert nodes == list(reversed(nodes_saved))


@given(
Expand Down Expand Up @@ -123,7 +123,7 @@ async def test_forward(runs: list[Run], first: int):

nodes.extend(edge['node'] for edge in edges)

assert nodes == nodes_saved
assert nodes == list(reversed(nodes_saved))


@given(
Expand Down Expand Up @@ -175,7 +175,7 @@ async def test_backward(runs: list[Run], last: int):

nodes.extend(edge['node'] for edge in reversed(edges))

assert nodes == list(reversed(nodes_saved))
assert nodes == nodes_saved


@given(runs=st_model_run_list(generate_traces=False, min_size=0, max_size=12))
Expand Down

0 comments on commit 8a26196

Please sign in to comment.