Skip to content

fix(flatten_authors): fallback to 'last_known_institutions' for institution id extraction (tested on Python 3.11.8)#12

Open
fsaudm wants to merge 2 commits intoourresearch:mainfrom
fsaudm:main
Open

fix(flatten_authors): fallback to 'last_known_institutions' for institution id extraction (tested on Python 3.11.8)#12
fsaudm wants to merge 2 commits intoourresearch:mainfrom
fsaudm:main

Conversation

@fsaudm
Copy link

@fsaudm fsaudm commented Feb 18, 2025

This PR updates flatten_authors to handle cases where the source uses 'last_known_institutions' instead of 'last_known_institution'. If 'last_known_institutions' exists and is a non-empty list, the function extracts the 'id' from its first element. Else, it falls back to 'last_known_institutions' or {}.

This change prevents most 'last_known_institution' entries in authors.csv from being null.

(Python 3.11.8)

@fsaudm fsaudm changed the title fix(flatten_authors): fallback to 'last_known_institutions' for institution id extraction fix(flatten_authors): fallback to 'last_known_institutions' for institution id extraction (tested on Python 3.11.8) Feb 18, 2025
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.

1 participant