-
Notifications
You must be signed in to change notification settings - Fork 70
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 function for fetching in progress responses, closing #220 #261
base: main
Are you sure you want to change the base?
Conversation
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.
Thank you so much for this contribution @jamesmartherus! 🙌
One thing I notice about this PR is that it copies a fair amount of code from fetch_survey()
. Instead of copy/pasting so much, can we create some helper functions that can be used for both functions?
The other thing we'll need here are some tests. We use vcr for testing, as outlined in rOpenSci's book on HTTP testing.
Thanks @juliasilge! I've addressed the deprecation and naming comments and added some tests. Great point about using helpers instead of copying so much code. One potential helper function could check if the survey is already in tempdir? The reason I ended up copying most of the |
Hey, just seeing this--this is great to have, thanks! And nice catch on avoiding the saved files overwriting any from FYI, I just put in a PR adding features to fetch_survey() that also also tried to make the function a bit more modular (and restructured arg checking). This includes a set of internal helper functions for the export-responses endpoint. I think that could be useful as a drop-in for both @juliasilge since these two functions are basically the same call, we could in theory consolidate just about everything into a shared internal function except the arg checks (if we're dropping the start/end args), payload/body build (same reason), and the file paths. But I don't know how far you might want to go on DRY. |
Merge branch 'master' into jamesmartherus-master # Conflicts: # R/utils.R # man/create_raw_payload.Rd
@jamesmartherus Thank you again so much for this new feature! Are you interested in making the changes based on #263? I do think @jmobrien's idea of making one internal function that is used by both of these user-facing functions is the right way to go, for long-term maintainability and avoiding bugs down the road. |
There's a function called |
I just moved this repo's default branch from |
Adds a function for downloading in progress responses. Closes #220