-
Notifications
You must be signed in to change notification settings - Fork 25
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
add support in .fetch_results
for retrieving results in multiple pages
#57
Conversation
This change improves the existing code based on the unexpected behavior reported in the following issue: rladies#55
} | ||
|
||
|
||
if((length(records) < total_records) & !is.null(res$headers$link)){ |
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.
if((length(records) < total_records) & !is.null(res$headers$link)){ | |
if ((length(records) < total_records) & !is.null(res$headers$link)) { |
# calculate number of offsets for records above 200 | ||
offsetn <- ceiling(total_records/length(records)) | ||
all_records <- list(records) | ||
for(i in 1:(offsetn - 1)) { |
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.
for(i in 1:(offsetn - 1)) { | |
for (i in 1:(offsetn - 1)) { |
Hi @benubah I support the changes, except that I got an error when running the code above. Since I needed the updated
I think it makes sense to add these changes in the other PR since they are related to the other PR and required to make that one fully functional (and also makes it easier to test). |
@ledell Please see a screenshot of my terminal. It works smoothly for me. I did not attach the .quick_fetch <- function(api_url,
api_key = NULL,
event_status = NULL,
offset = 0,
...) Feel free to let me know if it still does not work. |
@benubah Thanks, I assume the error I got had to do with me copy/pasting code. I'll try it out on the other PR... |
Hi @benubah can you fix the conflict so we can get this merged? Sorry again for not merging this last year. |
👋 @benubah |
Given the changes that were made in the default branch, and given that some functions already handle pagination, I think it might be easier to start from scratch/ using code from these functions. |
This change improves the existing code based on the unexpected behavior reported in the following issue #55