ropensci / openalexR

Getting bibliographic records from OpenAlex
https://docs.ropensci.org/openalexR/
Other
97 stars 21 forks source link

flatten df chunks #198

Closed yjunechoe closed 8 months ago

yjunechoe commented 8 months ago

Resolves #197

This PR changes the rbind() to bind over single rows vs. chunks (of up to 50).

The reprex in #197 fetches info about the 51 author IDs in two chunks - 1-50 and 51. Instead of binding the 50-row df to the 1-row df (which caused a cryptic column incompatibility error), the PR un-does the chunking right before rbind() to ensure that it receives 51 1-row dfs. This resolves the error because it lets rbind() make better guesses about the most compatible column type across the dfs.

yjunechoe commented 8 months ago

FYI tests failing from oa_ngrams because the ngrams API is down (none of the links in the docs work atm - https://docs.openalex.org/api-entities/works/get-n-grams).

Reminding myself to re-run the GHAs at a later time (they seem to be slowly coming back online, but the ones we use in test are still down)