interloper-api 0.67.0__tar.gz → 0.68.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.67.0 → interloper_api-0.68.0}/PKG-INFO +1 -1
  2. {interloper_api-0.67.0 → interloper_api-0.68.0}/pyproject.toml +1 -1
  3. {interloper_api-0.67.0 → interloper_api-0.68.0}/pyproject.toml.orig +1 -1
  4. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/runs.py +16 -19
  5. {interloper_api-0.67.0 → interloper_api-0.68.0}/README.md +0 -0
  6. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/__init__.py +0 -0
  7. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/app.py +0 -0
  8. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/__init__.py +0 -0
  9. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/auth.py +0 -0
  10. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/rbac.py +0 -0
  11. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/dependencies/state.py +0 -0
  12. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/notifications/__init__.py +0 -0
  13. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/notifications/invitations.py +0 -0
  14. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/__init__.py +0 -0
  15. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/admin.py +0 -0
  16. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/agent.py +0 -0
  17. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/auth.py +0 -0
  18. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/backfills.py +0 -0
  19. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/catalog.py +0 -0
  20. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/components.py +0 -0
  21. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/health.py +0 -0
  22. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/oauth.py +0 -0
  23. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/organisations.py +0 -0
  24. {interloper_api-0.67.0 → interloper_api-0.68.0}/src/interloper_api/routes/tokens.py +0 -0
  25. {interloper_api-0.67.0 → interloper_api-0.68.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.67.0
3
+ Version: 0.68.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.67.0"
3
+ version = "0.68.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.67.0"
6
+ version = "0.68.0"
7
7
  description = "Interloper FastAPI routes"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Guillaume Onfroy", email = "guillaume@digitlcloud.com" }]
@@ -7,7 +7,6 @@ from typing import Annotated, Literal
7
7
  from uuid import UUID
8
8
 
9
9
  from fastapi import APIRouter, Depends, HTTPException, Query, Response
10
- from interloper.component import KINDS
11
10
  from interloper.errors import NotFoundError
12
11
  from interloper_db import Profile, Store
13
12
  from interloper_db.models import Event, Run
@@ -88,13 +87,13 @@ class RetryRequest(BaseModel):
88
87
  scope: Literal["all", "failed"] = "all"
89
88
 
90
89
 
91
- class AssetExecutionResponse(BaseModel):
92
- """Response body for an asset execution (from the asset_executions view)."""
90
+ class ExecutionResponse(BaseModel):
91
+ """Response body for an operation execution (from the ``executions`` view)."""
93
92
 
94
93
  run_id: UUID
95
94
  org_id: UUID
96
- asset_id: UUID | None = None
97
- asset_key: str
95
+ component_id: UUID | None = None
96
+ component_key: str
98
97
  status: str
99
98
  started_at: str | None = None
100
99
  completed_at: str | None = None
@@ -238,7 +237,7 @@ def create_run(
238
237
  user: Profile = Depends(get_current_user),
239
238
  store: Store = Depends(get_store),
240
239
  ) -> RunResponse:
241
- """Queue a single run targeting a runnable component (job, source, or asset).
240
+ """Queue a single run targeting a component whose kind declares an operation.
242
241
 
243
242
  Args:
244
243
  body: The component to run and the partition key to run it for.
@@ -249,12 +248,10 @@ def create_run(
249
248
  The queued run, as a response model.
250
249
 
251
250
  Raises:
252
- HTTPException: 400 if the component's kind is not runnable, or if the
253
- store rejects the run.
251
+ HTTPException: 400 if the store rejects the run (a kind with no
252
+ operation, or an invalid partition key).
254
253
  """
255
254
  target = load_authorized(store.components.get, body.component_id, user, store, label="Component", minimum="editor")
256
- if not KINDS[target.kind].runnable:
257
- raise HTTPException(status_code=400, detail=f"Components of kind '{target.kind}' cannot be run")
258
255
  try:
259
256
  run = store.runs.create(target.org_id, component_id=body.component_id, partition_key=body.partition_key)
260
257
  except ValueError as e:
@@ -282,13 +279,13 @@ def get_run(
282
279
  return RunResponse.from_run(run)
283
280
 
284
281
 
285
- @router.get("/{run_id}/asset-executions")
286
- def list_asset_executions(
282
+ @router.get("/{run_id}/executions")
283
+ def list_executions(
287
284
  run_id: UUID,
288
285
  user: Profile = Depends(get_current_user),
289
286
  store: Store = Depends(get_store),
290
- ) -> list[AssetExecutionResponse]:
291
- """List asset executions for a run.
287
+ ) -> list[ExecutionResponse]:
288
+ """List operation executions for a run.
292
289
 
293
290
  Args:
294
291
  run_id: The run UUID.
@@ -296,16 +293,16 @@ def list_asset_executions(
296
293
  store: The Store instance.
297
294
 
298
295
  Returns:
299
- The run's asset executions, as response models.
296
+ The run's operation executions, as response models.
300
297
  """
301
298
  _load_authorized_run(run_id, user, store)
302
- rows = store.events.list_asset_executions(run_id)
299
+ rows = store.events.list_executions(run_id)
303
300
  return [
304
- AssetExecutionResponse(
301
+ ExecutionResponse(
305
302
  run_id=row.run_id,
306
303
  org_id=row.org_id,
307
- asset_id=row.asset_id,
308
- asset_key=row.asset_key or "",
304
+ component_id=row.component_id,
305
+ component_key=row.component_key or "",
309
306
  status=row.status,
310
307
  started_at=str(row.started_at) if row.started_at else None,
311
308
  completed_at=str(row.completed_at) if row.completed_at else None,