-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protect against missing cols from cr_works / missing fields from crossref API #183
Comments
cr_works only parses fields that are returned by the Crossref API. E.g., http://api.crossref.org/v1/works/10.1109/JLT.2019.2961931 lacks license and reference nodes. Not sure how parsing the raw json would help. |
I know, similar to what If we're unlucky, none of them do, and then Anyway, it's not a priority, and depending on which fields we use it might be very unlikely. |
Uh, that's a bummer, thanks for pointing that out. crossref then! 😡 Just to show that I'm not making these expectations up; usual best standard for APIs is to always show all response fields:
So, bottom line: it would be possible, though inelegant / unreasonable expectation for rcrossref or any other client to work around this (they'd have to maintain a full list of all possible fields and As a backstop, we should make a list of fields which we actually use, and then test on ingest whether these fields are available for all rows and drop those rows. In any case, we should be very defensive and fail/drop as early as possible. |
also raised this over at crossref: CrossRef/rest-api-doc#551 |
it occurs to me, we've already run into a version of this bug in #117. |
when a field is
NA
(?),cr_works()
just drops the column:Created on 2021-03-04 by the reprex package (v1.0.0)
This is pretty dangerous.
purrr::map_dfr()
in #168 should cover many of these cases, but not deterministically.We should either:
always assert the fields we actually need, and only keep those.(that might still cause an error)
The text was updated successfully, but these errors were encountered: