fix(tap-uk-ees): handle plain list response from releases endpoint
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 33s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m6s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 1m45s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 33s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m6s
Build and Push Docker Images / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 1m45s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,19 +34,12 @@ def get_content_release_id(publication_slug: str) -> str:
|
||||
def get_all_release_ids(publication_slug: str) -> list[str]:
|
||||
"""Return all release IDs for a publication, newest first."""
|
||||
url = f"{CONTENT_API_BASE}/publications/{publication_slug}/releases"
|
||||
ids = []
|
||||
page = 1
|
||||
while True:
|
||||
resp = requests.get(url, params={"page": page, "pageSize": 20}, timeout=TIMEOUT)
|
||||
resp = requests.get(url, timeout=TIMEOUT)
|
||||
resp.raise_for_status()
|
||||
data = resp.json()
|
||||
for r in data.get("results", []):
|
||||
ids.append(r["id"])
|
||||
paging = data.get("paging", {})
|
||||
if page >= paging.get("totalPages", 1):
|
||||
break
|
||||
page += 1
|
||||
return ids
|
||||
# API returns either a plain list or a paginated object with a "results" key
|
||||
releases = data if isinstance(data, list) else data.get("results", [])
|
||||
return [r["id"] for r in releases]
|
||||
|
||||
|
||||
def download_release_zip(release_id: str) -> zipfile.ZipFile:
|
||||
|
||||
Reference in New Issue
Block a user