-
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
Bug in internals.R? #55
Comments
This change improves the existing code based on the unexpected behavior reported in the following issue: rladies#55
@ledell My guess on the issue with the code is that it does not add the For example: R user groups on meetup.com are above 450, so I have to query the API 3 times with different parameters for # first call, offset is automatically set to 0 by the API. Returns 200 records
https://api.meetup.com/find/groups?radius=global&text=r-project-for-statistical-computing&topic_id=98380&key=xxxxxxx
# second call returns another 200 records
https://api.meetup.com/find/groups?radius=global&text=r-project-for-statistical-computing&topic_id=98380&key=xxxxxxx&offset=1
# third call returns the remaining records
https://api.meetup.com/find/groups?radius=global&text=r-project-for-statistical-computing&topic_id=98380&key=xxxxxxx&offset=2 Highlight on how I am including offsetn <- ceiling(total_records/length(records))
for(i in 1:(offsetn - 1)) {
res <- .quick_fetch(api_url = api_url,
api_key = api_key,
event_status = event_status,
offset = i,
...)
all_records[[i + 1]] <- res$result
} I submitted a pull request with my changes: #57 Yes, I am aware of the ongoing re-factoring based on OAUTH authentication. I have been watching to see the direction things will take as my work depends largely on this package. Thank you. |
@benubah The |
@ledell Yes, This unexpected behavior occurs when the additional # this is the modified find_groups() in my pull request that allows requesting additional fields
# please note that I am requesting four additional data attributes using fields
all_ruser_groups <- find_groups(text = "r-project-for-statistical-computing", fields = "past_event_count, upcoming_event_count, last_event, topics", api_key = meetup_api_key)
# for 1 - 200, record parameters are fully returned - default and additional
all_ruser_groups$resource[[1]]$last_event
all_ruser_groups$resource[[100]]$topics
all_ruser_groups$resource[[200]]$last_event
# returns the correct values
# For 201 - 482, additional parameters in `fields` are not fully returned, but default parameters are returned.
all_ruser_groups$resource[[201]]$last_event
all_ruser_groups$resource[[482]]$topics
all_ruser_groups$resource[[482]]$upcoming_event_count
# they all return NULL, but they have values at meetup
This meant to me that This returned all additional fields completely. The data obtained via additional |
@ledell Just to show how useful the additional fields are to my project, please see the screenshot below. We can see the Last Event date, calculate Months Inactive, Past and Upcoming Event Counts right in the pop-ups on the map. We can apply different colors to Active, Inactive and Unbegun groups. Thank you |
@benubah See my comments here: #57 (comment) |
Hi @benubah Do you know if this is still an issue? I know there were some internal changes after the OAuth upgrade, so I am wondering if this has been resolved. |
#48 has been merged so should this issue be closed? I am working on OAuth stuff and looking at open issues. |
Feel free to close. |
thank you! |
My work using this package to explore R User groups based on a modified version of
find_groups()
(provided within this pull request #48 ) that retrieves additional fields has revealed an unexpected behavior.Consider the code below:
There are 481 records returned for this query. For records, between 0 - 199, everything is fine. But for records between 200 - 481, there are no entries for
upcoming_event_count, last_event, topics
. Only the first additional fieldpast_event_count
is returned.I guessed that the problem could be from the following portion of
.fetch_results()
function withininternals.R
:I re-wrote this portion and got a working solution for my work. Possibly could send a pull request soon.
@ledell @LucyMcGowan Any thoughts?
The text was updated successfully, but these errors were encountered: