Skip to content
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

Paginate the Dimensions works response #52

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Paginate the Dimensions works response #52

merged 1 commit into from
Jun 25, 2024

Conversation

edsu
Copy link
Contributor

@edsu edsu commented Jun 24, 2024

A batch size of 75 exceeds the default page size of 50, which means 25 DOIs will not be returned, unless pagination is used. This commit adds pagination with a page size of 200 (the max) and modifies the test to make sure that the pagination is happening by trying to get metadata for 250 DOIs.

A batch size of 75 exceeds the page size of 50, which means 25 DOIs will
not be returned unless pagination is used. This commit adds pagination
with a page size of 200 (the max) and modifies the test to make sure
that the pagination is happening.
@edsu edsu force-pushed the openalex-paginate branch from d291bc0 to 8692b89 Compare June 24, 2024 23:02
@@ -0,0 +1,232 @@
doi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are DOIs that have metadata in OpenAlex.


# look up the publication metadata for them
pubs = list(openalex.publications_from_dois(dois))
assert len(pubs) == 231, "should paginate (page size=200)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure we got back more than 200 that demonstrates that paging is working.

@edsu edsu merged commit f8972f4 into main Jun 25, 2024
1 check passed
@edsu edsu deleted the openalex-paginate branch June 25, 2024 15:41
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