Add committee memberships; tolerate empty EP declaration responses
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b4e26bb296
commit
9c58bb3d8f
8 files changed
+457
-2
No files matched your search
@@ -129,6 +129,9 @@ class EuropeanParliament(Adapter):
|
||||
params={"country-of-representation": "AT", "format": "application/ld+json", "limit": 100})
|
||||
|
||||
def parse(self, ctx: RunContext, response: Response) -> Iterator[Any]:
|
||||
if not response.body.strip(): # the API answers some MEPs' declaration requests with an empty body
|
||||
ctx.stats["empty_responses"] += 1
|
||||
return
|
||||
data = response.json().get("data") or []
|
||||
if response.request.kind == "meps":
|
||||
for mep in data:
|
||||
@@ -243,6 +246,9 @@ class ParliamentVotes(Adapter):
|
||||
meta={"ep_ids": ep_ids})
|
||||
|
||||
def parse(self, ctx: RunContext, response: Response) -> Iterator[Any]:
|
||||
if not response.body.strip(): # sittings without recorded votes come back with an empty body
|
||||
ctx.stats["empty_responses"] += 1
|
||||
return
|
||||
kind = response.request.kind
|
||||
data = response.json().get("data") or []
|
||||
meta = response.meta
|
||||
|
||||
Reference in new issue
Block a user