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.
Files changed (21) hide show
  1. {interloper_api-0.61.0 → interloper_api-0.63.0}/PKG-INFO +1 -1
  2. {interloper_api-0.61.0 → interloper_api-0.63.0}/pyproject.toml +1 -1
  3. {interloper_api-0.61.0 → interloper_api-0.63.0}/pyproject.toml.orig +1 -1
  4. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/backfills.py +18 -16
  5. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/runs.py +7 -4
  6. {interloper_api-0.61.0 → interloper_api-0.63.0}/README.md +0 -0
  7. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/__init__.py +0 -0
  8. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/app.py +0 -0
  9. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/components.py +0 -0
  10. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/dependencies.py +0 -0
  11. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/email.py +0 -0
  12. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/__init__.py +0 -0
  13. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/admin.py +0 -0
  14. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/agent.py +0 -0
  15. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/auth.py +0 -0
  16. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/catalog.py +0 -0
  17. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/components.py +0 -0
  18. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/oauth.py +0 -0
  19. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/organisations.py +0 -0
  20. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/tokens.py +0 -0
  21. {interloper_api-0.61.0 → interloper_api-0.63.0}/src/interloper_api/routes/ws.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: interloper-api
3
- Version: 0.61.0
3
+ Version: 0.63.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.61.0"
3
+ version = "0.63.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.61.0"
6
+ version = "0.63.0"
7
7
  description = "Interloper FastAPI routes"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Guillaume Onfroy", email = "guillaume@digitlcloud.com" }]
@@ -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
- start_date: dt.date
31
- end_date: dt.date
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
- start_date: dt.date
44
- end_date: dt.date
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
- start_date=backfill.start_date,
68
- end_date=backfill.end_date,
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 date range."""
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
- backfill = store.create_backfill(
104
- job.org_id,
105
- component_id=body.component_id,
106
- start_date=body.start_date,
107
- end_date=body.end_date,
108
- concurrency=body.concurrency,
109
- fail_fast=body.fail_fast,
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
- partition_date: dt.date | None
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
- partition_date: dt.date | None = None
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
- partition_date=run.partition_date,
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
- run = store.create_run(target.org_id, component_id=body.component_id, partition_date=body.partition_date)
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