Skip to content

Fixes --enrich crashes caused by unexpected API responses and non-string identifier values - #1129

Merged
dgarijo merged 5 commits into
KnowledgeCaptureAndDiscovery:devfrom
SergioZSZ:master
Oct 1, 2026
Merged

dgarijo merged 5 commits into
KnowledgeCaptureAndDiscovery:devfrom
SergioZSZ:master

Conversation

@SergioZSZ

Copy link
Copy Markdown
Contributor

Enrich fixes

Fixes --enrich crashes caused by unexpected API responses and non-string identifier values.

Issue

#1126

Summary

The original error happened because OpenAIRE could return response: null, making chained .get() calls fail

  • Added _safe_json_response() to safely parse API JSON and ignore invalid/non-dict responses
  • Hardened OpenAIRE/OpenAlex enrichment so missing or malformed fields return None instead of crashing
  • Added _extract_doi_from_value() to extract DOIs from strings, dicts, or lists preventing re.search() from receiving lists when metadata identifiers are structured

The enrichment flow now falls back cleanly when external services or metadata shapes are incomplete

@dgarijo
dgarijo merged commit 66e7e0f into KnowledgeCaptureAndDiscovery:dev Oct 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants