From ee53062606c6d194c52013063c4ff414fc762a00 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 9 Apr 2020 18:38:23 -0700 Subject: handle ext_ids without _id in release schema --- fatcat_covid19/transform.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'fatcat_covid19') diff --git a/fatcat_covid19/transform.py b/fatcat_covid19/transform.py index 1d2fa7c..7803085 100644 --- a/fatcat_covid19/transform.py +++ b/fatcat_covid19/transform.py @@ -67,14 +67,17 @@ def fulltext_to_elasticsearch(row, force_bool=True): 'pmcid', 'isbn13', 'wikidata_qid', - 'arxiv_id', - 'jstor_id', - 'mag_id', + 'arxiv', + 'jstor', + 'mag', ] for key in BIBLIO_KEYS: t[key] = release.get(key) or None for key in EXT_IDS: - t[key] = release['ext_ids'].get(key) or None + if key in ['arxiv', 'jstor', 'mag']: + t[key + "_id"] = release['ext_ids'].get(key) or None + else: + t[key] = release['ext_ids'].get(key) or None t['contrib_count'] = len(release['contribs'] or []) -- cgit v1.2.3