interloper-api 0.94.2__tar.gz → 0.96.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {interloper_api-0.94.2 → interloper_api-0.96.0}/PKG-INFO +1 -1
  2. {interloper_api-0.94.2 → interloper_api-0.96.0}/pyproject.toml +1 -1
  3. {interloper_api-0.94.2 → interloper_api-0.96.0}/pyproject.toml.orig +1 -1
  4. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/runs.py +25 -14
  5. {interloper_api-0.94.2 → interloper_api-0.96.0}/README.md +0 -0
  6. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/__init__.py +0 -0
  7. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/app.py +0 -0
  8. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/dependencies/__init__.py +0 -0
  9. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/dependencies/auth.py +0 -0
  10. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/dependencies/rbac.py +0 -0
  11. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/dependencies/state.py +0 -0
  12. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/notifications/__init__.py +0 -0
  13. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/notifications/invitations.py +0 -0
  14. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/__init__.py +0 -0
  15. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/admin.py +0 -0
  16. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/agent.py +0 -0
  17. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/auth.py +0 -0
  18. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/backfills.py +0 -0
  19. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/catalog.py +0 -0
  20. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/components.py +0 -0
  21. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/health.py +0 -0
  22. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/oauth.py +0 -0
  23. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/organisations.py +0 -0
  24. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/tokens.py +0 -0
  25. {interloper_api-0.94.2 → interloper_api-0.96.0}/src/interloper_api/routes/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: interloper-api
3
- Version: 0.94.2
3
+ Version: 0.96.0
4
4
  Summary: Interloper FastAPI routes
5
5
  Author: Guillaume Onfroy
6
6
  Author-email: Guillaume Onfroy <guillaume@digitlcloud.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "interloper-api"
3
- version = "0.94.2"
3
+ version = "0.96.0"
4
4
  description = "Interloper FastAPI routes"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -3,7 +3,7 @@
3
3
  # ###############
4
4
  [project]
5
5
  name = "interloper-api"
6
- version = "0.94.2"
6
+ version = "0.96.0"
7
7
  description = "Interloper FastAPI routes"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Guillaume Onfroy", email = "guillaume@digitlcloud.com" }]
@@ -240,6 +240,7 @@ def list_runs(
240
240
  component_kind: str | None = None,
241
241
  component_key: str | None = None,
242
242
  root_run_id: UUID | None = None,
243
+ sort: str | None = None,
243
244
  limit: int = 50,
244
245
  offset: int = 0,
245
246
  ) -> list[RunResponse]:
@@ -271,6 +272,9 @@ def list_runs(
271
272
  component_key: Keep only runs targeting a component of this type (catalog key); None
272
273
  applies no filter.
273
274
  root_run_id: List this stack's attempts rather than one row per stack.
275
+ sort: The field to order by (``id``, ``partition_key``, ``status``,
276
+ ``created_at``, ``started_at`` or ``completed_at``), ``-``-prefixed
277
+ for descending; None lists newest first.
274
278
  limit: Maximum number of runs on the page.
275
279
  offset: Number of matching runs to skip before the page starts.
276
280
  user: The authenticated user, required to hold at least the ``viewer`` role.
@@ -279,6 +283,9 @@ def list_runs(
279
283
 
280
284
  Returns:
281
285
  The matching page of runs, as response models.
286
+
287
+ Raises:
288
+ HTTPException: 400 if ``sort`` names a field runs cannot be ordered by.
282
289
  """
283
290
  total = store.runs.count(
284
291
  org_id,
@@ -293,20 +300,24 @@ def list_runs(
293
300
  root_run_id=root_run_id,
294
301
  )
295
302
  response.headers["X-Total-Count"] = str(total)
296
- runs = store.runs.list_all(
297
- org_id,
298
- component_id=component_id,
299
- backfill_id=backfill_id,
300
- status=status,
301
- after=after,
302
- before=before,
303
- q=q,
304
- component_kind=component_kind,
305
- component_key=component_key,
306
- root_run_id=root_run_id,
307
- limit=limit,
308
- offset=offset,
309
- )
303
+ try:
304
+ runs = store.runs.list_all(
305
+ org_id,
306
+ component_id=component_id,
307
+ backfill_id=backfill_id,
308
+ status=status,
309
+ after=after,
310
+ before=before,
311
+ q=q,
312
+ component_kind=component_kind,
313
+ component_key=component_key,
314
+ root_run_id=root_run_id,
315
+ sort=sort,
316
+ limit=limit,
317
+ offset=offset,
318
+ )
319
+ except ValueError as e:
320
+ raise HTTPException(status_code=400, detail=str(e))
310
321
  counts = store.events.count_executions([run.id for run in runs])
311
322
  return [RunResponse.from_run(run, counts.get(run.id)) for run in runs]
312
323