interloper-api 0.21.0__tar.gz → 0.22.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 (32) hide show
  1. {interloper_api-0.21.0 → interloper_api-0.22.0}/PKG-INFO +1 -1
  2. {interloper_api-0.21.0 → interloper_api-0.22.0}/pyproject.toml +1 -1
  3. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/runs.py +14 -9
  4. {interloper_api-0.21.0 → interloper_api-0.22.0}/README.md +0 -0
  5. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/__init__.py +0 -0
  6. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/app.py +0 -0
  7. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/dependencies.py +0 -0
  8. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/email.py +0 -0
  9. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/__init__.py +0 -0
  10. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/admin.py +0 -0
  11. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/agent.py +0 -0
  12. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/assets.py +0 -0
  13. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/auth.py +0 -0
  14. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/backfills.py +0 -0
  15. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/catalog.py +0 -0
  16. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/destinations.py +0 -0
  17. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/__init__.py +0 -0
  18. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/amazon_ads.py +0 -0
  19. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/criteo.py +0 -0
  20. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/facebook_ads.py +0 -0
  21. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/google_ads.py +0 -0
  22. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/google_cloud.py +0 -0
  23. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/impact.py +0 -0
  24. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/pinterest_ads.py +0 -0
  25. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/snapchat_ads.py +0 -0
  26. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/external/tiktok_ads.py +0 -0
  27. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/jobs.py +0 -0
  28. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/oauth.py +0 -0
  29. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/organisations.py +0 -0
  30. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/resources.py +0 -0
  31. {interloper_api-0.21.0 → interloper_api-0.22.0}/src/interloper_api/routes/sources.py +0 -0
  32. {interloper_api-0.21.0 → interloper_api-0.22.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.21.0
3
+ Version: 0.22.0
4
4
  Summary: Interloper FastAPI routes
5
5
  Author: Guillaume Onfroy
6
6
  Author-email: Guillaume Onfroy <guillaume@digitlcloud.com>
@@ -3,7 +3,7 @@
3
3
  # ###############
4
4
  [project]
5
5
  name = "interloper-api"
6
- version = "0.21.0"
6
+ version = "0.22.0"
7
7
  description = "Interloper FastAPI routes"
8
8
  readme = "README.md"
9
9
  authors = [{ name = "Guillaume Onfroy", email = "guillaume@digitlcloud.com" }]
@@ -3,10 +3,10 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import datetime as dt
6
- from typing import Literal
6
+ from typing import Annotated, Literal
7
7
  from uuid import UUID
8
8
 
9
- from fastapi import APIRouter, Depends, HTTPException, Response
9
+ from fastapi import APIRouter, Depends, HTTPException, Query, Response
10
10
  from interloper.errors import NotFoundError
11
11
  from interloper_db import Profile, Store
12
12
  from interloper_db.models import Event, Run
@@ -244,23 +244,28 @@ def list_run_events(
244
244
  response: Response,
245
245
  limit: int = 100,
246
246
  offset: int = 0,
247
- asset_id: UUID | None = None,
247
+ asset_id: Annotated[list[UUID] | None, Query()] = None,
248
+ event_type: Annotated[list[str] | None, Query()] = None,
248
249
  user: Profile = Depends(get_current_user),
249
250
  store: Store = Depends(get_store),
250
251
  ) -> list[EventResponse]:
251
252
  """List events for a run, oldest first.
252
253
 
253
254
  Events are ordered ``timestamp ASC`` and paged with ``limit``/``offset``.
254
- ``asset_id`` narrows the listing to one asset's events. The total number
255
- of matching events (ignoring ``limit``/``offset``, honouring ``asset_id``)
256
- is returned in the ``X-Total-Count`` response header so clients can page
257
- through every event including the terminal/outcome events
255
+ ``asset_id`` and ``event_type`` may each be repeated to narrow the listing
256
+ to one or more assets (e.g. every asset sharing a status) and/or event
257
+ types (e.g. a "Lifecycle"/"Errors"/"Logs" tab); the two compose. The total
258
+ number of matching events (ignoring ``limit``/``offset``, honouring the
259
+ filters) is returned in the ``X-Total-Count`` response header so clients can
260
+ page through every event — including the terminal/outcome events
258
261
  (``asset_completed``, ``asset_failed``, ``run_failed``, …) that sort last.
259
262
  """
260
263
  _load_authorized_run(run_id, user, store)
261
264
  limit = max(1, min(limit, MAX_EVENTS_PAGE_SIZE))
262
265
  offset = max(0, offset)
263
- total = store.count_events(run_id=run_id, asset_id=asset_id)
266
+ total = store.count_events(run_id=run_id, asset_ids=asset_id, event_types=event_type)
264
267
  response.headers["X-Total-Count"] = str(total)
265
- events = store.list_events(run_id=run_id, asset_id=asset_id, limit=limit, offset=offset)
268
+ events = store.list_events(
269
+ run_id=run_id, asset_ids=asset_id, event_types=event_type, limit=limit, offset=offset
270
+ )
266
271
  return [_event_to_response(e) for e in events]