-
Notifications
You must be signed in to change notification settings - Fork 3
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
DataCite Query Pagination Support #263
Conversation
… record index numbers with warnings when an optional field cannot be parsed
…initialize_production_deployment.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my question but otherwise looks fine 👌
|
||
# Append current results to full set returned | ||
result = json.loads(datacite_response.text) | ||
data.extend(result['data']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will there ever be a concern that data
grows overly large if, say, the totalPages
is also overly large? Should we be using a generator style pattern here to compensate instead of gathering and returning the entire kit & kaboodle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say this is not currently a concern based on two things:
- Based on the performance I observed importing all 1300+ records currently available on DataCite (which is only about a page and half):
INFO __main__:main DOI import complete in 23.26 seconds.
INFO __main__:main Num records found: 1390
INFO __main__:main Num records processed: 1390
INFO __main__:main Num records written: 1390
INFO __main__:main Num records skipped: 0
- This query function is only used right now for the local database importation script, so for the time being we shouldn't have to worry about an end-user of the service/UI running into some sort of performance bottleneck because we slurp all available pages.
Thanks @collinss-jpl! |
🗒️ Summary
This PR adds support for DataCite's pagination scheme to the query function used to pull down existing DOI records from a DataCite server. This functionality should have been included with the original addition of DataCite support, but was overlooked.
In addition to pagination support, this branch adds several other small improvements, including:
⚙️ Test Data and/or Report
One of the following should be included here:
A unit test has been added for the pagination support added to the DataCite web client.
test.txt
♻️ Related Issues
Fixes #261