interloper-api 0.61.0__tar.gz → 0.63.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.
- {interloper_api-0.61.0 → interloper_api-0.63.0}/PKG-INFO +1 -1
- {interloper_api-0.61.0 → interloper_api-0.63.0}/pyproject.toml +1 -1
- {interloper_api-0.61.0 → interloper_api-0.63.0}/pyproject.toml.orig +1 -1
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/backfills.py +18 -16
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/runs.py +7 -4
- {interloper_api-0.61.0 → interloper_api-0.63.0}/README.md +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/__init__.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/app.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/components.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/dependencies.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/email.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/__init__.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/admin.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/agent.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/auth.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/catalog.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/components.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/oauth.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/organisations.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/tokens.py +0 -0
- {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/ws.py +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import datetime as dt
|
|
6
5
|
from uuid import UUID
|
|
7
6
|
|
|
8
7
|
from fastapi import APIRouter, Depends, HTTPException
|
|
@@ -27,8 +26,8 @@ class BackfillCreateRequest(BaseModel):
|
|
|
27
26
|
"""Request body for queuing a backfill."""
|
|
28
27
|
|
|
29
28
|
component_id: UUID
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
start_key: str
|
|
30
|
+
end_key: str
|
|
32
31
|
concurrency: int = 1
|
|
33
32
|
fail_fast: bool = False
|
|
34
33
|
|
|
@@ -40,8 +39,8 @@ class BackfillResponse(BaseModel):
|
|
|
40
39
|
org_id: UUID
|
|
41
40
|
component_id: UUID | None
|
|
42
41
|
status: str
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
start_key: str
|
|
43
|
+
end_key: str
|
|
45
44
|
concurrency: int
|
|
46
45
|
fail_fast: bool
|
|
47
46
|
partitions: int
|
|
@@ -64,8 +63,8 @@ def _backfill_to_response(backfill: Backfill) -> BackfillResponse:
|
|
|
64
63
|
org_id=backfill.org_id,
|
|
65
64
|
component_id=backfill.component_id,
|
|
66
65
|
status=backfill.status,
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
start_key=backfill.start_key,
|
|
67
|
+
end_key=backfill.end_key,
|
|
69
68
|
concurrency=backfill.concurrency,
|
|
70
69
|
fail_fast=backfill.fail_fast,
|
|
71
70
|
partitions=backfill.partitions,
|
|
@@ -96,18 +95,21 @@ def create_backfill(
|
|
|
96
95
|
user: Profile = Depends(get_current_user),
|
|
97
96
|
store: Store = Depends(get_store),
|
|
98
97
|
) -> BackfillResponse:
|
|
99
|
-
"""Queue a backfill for a job over a
|
|
98
|
+
"""Queue a backfill for a job over a partition-key range."""
|
|
100
99
|
job = load_authorized(
|
|
101
100
|
lambda i: store.get_component(i, kind="job"), body.component_id, user, store, label="Job", minimum="editor"
|
|
102
101
|
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
try:
|
|
103
|
+
backfill = store.create_backfill(
|
|
104
|
+
job.org_id,
|
|
105
|
+
component_id=body.component_id,
|
|
106
|
+
start_key=body.start_key,
|
|
107
|
+
end_key=body.end_key,
|
|
108
|
+
concurrency=body.concurrency,
|
|
109
|
+
fail_fast=body.fail_fast,
|
|
110
|
+
)
|
|
111
|
+
except ValueError as e:
|
|
112
|
+
raise HTTPException(status_code=400, detail=str(e))
|
|
111
113
|
return _backfill_to_response(backfill)
|
|
112
114
|
|
|
113
115
|
|
|
@@ -37,7 +37,7 @@ class RunResponse(BaseModel):
|
|
|
37
37
|
org_id: UUID
|
|
38
38
|
component_id: UUID | None
|
|
39
39
|
backfill_id: UUID | None
|
|
40
|
-
|
|
40
|
+
partition_key: str | None
|
|
41
41
|
status: str
|
|
42
42
|
retry_of: UUID | None = None
|
|
43
43
|
attempt: int = 1
|
|
@@ -51,7 +51,7 @@ class RunCreateRequest(BaseModel):
|
|
|
51
51
|
"""Request body for queuing a run targeting a runnable component."""
|
|
52
52
|
|
|
53
53
|
component_id: UUID
|
|
54
|
-
|
|
54
|
+
partition_key: str | None = None
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
class RetryRequest(BaseModel):
|
|
@@ -105,7 +105,7 @@ def _run_to_response(run: Run) -> RunResponse:
|
|
|
105
105
|
org_id=run.org_id,
|
|
106
106
|
component_id=run.component_id,
|
|
107
107
|
backfill_id=run.backfill_id,
|
|
108
|
-
|
|
108
|
+
partition_key=run.partition_key,
|
|
109
109
|
status=run.status,
|
|
110
110
|
retry_of=run.retry_of,
|
|
111
111
|
attempt=run.attempt,
|
|
@@ -217,7 +217,10 @@ def create_run(
|
|
|
217
217
|
target = load_authorized(store.get_component, body.component_id, user, store, label="Component", minimum="editor")
|
|
218
218
|
if not KINDS[target.kind].runnable:
|
|
219
219
|
raise HTTPException(status_code=400, detail=f"Components of kind '{target.kind}' cannot be run")
|
|
220
|
-
|
|
220
|
+
try:
|
|
221
|
+
run = store.create_run(target.org_id, component_id=body.component_id, partition_key=body.partition_key)
|
|
222
|
+
except ValueError as e:
|
|
223
|
+
raise HTTPException(status_code=400, detail=str(e))
|
|
221
224
|
return _run_to_response(run)
|
|
222
225
|
|
|
223
226
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|