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

Add improvments #17

Merged
merged 28 commits into from
Mar 30, 2022
Merged

Add improvments #17

merged 28 commits into from
Mar 30, 2022

Conversation

Aeilert
Copy link
Collaborator

@Aeilert Aeilert commented Mar 25, 2022

  • Add get_wb() as a short hand for getting global and regional WB stats
  • Change exposed "group" option from group_by to subgroup
  • Add temp fix for renaming of columns
  • Add a user agent to all API requests (following advice here)
  • Decide on using .onLoad (not onAttach) in zzz.R
  • Some updates to GH workflows
  • Use rds as default query format
  • Add prod url as internal package variable

Closes #11
Closes #12
Closes #6

@Aeilert Aeilert added the enhancement New feature or request label Mar 25, 2022
@Aeilert Aeilert requested a review from tonyfujs March 25, 2022 09:16
@Aeilert Aeilert self-assigned this Mar 25, 2022
Aleksander Eilertsen added 6 commits March 25, 2022 06:22
* /versions returns a data frame by default
* /aux returns a data frame by default
* Invalid queries now correctly trigger a 404 response
Copy link
Member

@tonyfujs tonyfujs left a comment

Choose a reason for hiding this comment

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

Hey @Aeilert
The unit tests for "Caching is enabled by default" fail for me, and it does not seem to be related to callr...

Also, what the rational for moving the messages back to .onLoad? devtools::check() still throwing a warning...

Otherwise everything looks good!

@Aeilert
Copy link
Collaborator Author

Aeilert commented Mar 28, 2022

thanks @tonyfujs

I'll check on the cache unit tests. Looks like they passed on GH, so not sure what could be wrong. But I will take a closer look to confirm.

Regarding .onLoad vs .onAttach: The startup-message should be linked to the actually triggering of the caching (based on the value of PIPR_DISABLE_CACHING), so the message needs to be wrapped inside the if-statement. In that sense I think we should either use onLoad or onAttach. But onAttach apparently does not work well with overwriting existing functionsin the namespace (which is what we do with get_stats <- memoise(get_stats) . I thus landed on .onLoad . The implication here is the caching (by default) will be enabled both when users call libary(pipr) and pipr::get_stats() (wo/ loading the library). I think that is acceptable (maybe even preferred?) .

@Aeilert
Copy link
Collaborator Author

Aeilert commented Mar 29, 2022

Hey @tonyfujs

I checked the caching unit tests and the all pass for me locally.

Aleksander Eilertsen added 2 commits March 30, 2022 02:54
Resolve note in R CMD check. Only give start up message when package is
loaded using library().
@Aeilert Aeilert merged commit 096f958 into main Mar 30, 2022
@Aeilert Aeilert deleted the dev branch March 30, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants