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

Initial switch to httr2 #738

Merged
merged 33 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
030edf4
First steps in switching to httr2
ldecicco-USGS Oct 23, 2024
84cb3cc
Getting there!
ldecicco-USGS Oct 24, 2024
ffbfaa3
udpates from main
ldecicco-USGS Oct 24, 2024
a8f236e
update ua
ldecicco-USGS Oct 24, 2024
ea8170a
start
ldecicco-USGS Oct 24, 2024
d829f26
Merge branch 'main' of https://code.usgs.gov/water/dataRetrieval into…
ldecicco-USGS Nov 1, 2024
6062607
cleaning up WQP calls
ldecicco-USGS Nov 1, 2024
af0b523
style
ldecicco-USGS Nov 1, 2024
f1bbab0
getting the lists correct
ldecicco-USGS Nov 2, 2024
993a2a4
More NWIS and WQP httr2 updates
ldecicco-USGS Nov 3, 2024
9fca4e2
a few httr2 updates
ldecicco-USGS Nov 4, 2024
313fdda
Fixing some tests. Mostly arguments in the URLs are shuffled around.
ldecicco-USGS Nov 4, 2024
f09bb35
wrong argument
ldecicco-USGS Nov 4, 2024
90cb26c
More tests to fix and update findNLDI
ldecicco-USGS Nov 4, 2024
746d32c
local file tests
ldecicco-USGS Nov 4, 2024
47e35a7
getting water use URLs to work
ldecicco-USGS Nov 5, 2024
790f924
more test url updates
ldecicco-USGS Nov 5, 2024
82318a9
everything except NGWMN working
ldecicco-USGS Nov 5, 2024
9792060
NGWMN
ldecicco-USGS Nov 5, 2024
111feb5
Dropping problimatic example (data source keeps changing)
ldecicco-USGS Nov 5, 2024
6bfc32a
Upstream pull
ldecicco-USGS Nov 5, 2024
d289745
adding count=no to legacy
ldecicco-USGS Nov 5, 2024
7ad1ed5
updating docker file
ldecicco-USGS Nov 5, 2024
20fa9e7
run check on develop
ldecicco-USGS Nov 5, 2024
8f93afe
Fix test due to my last minute addition of count=no to legacy WQP
ldecicco-USGS Nov 5, 2024
8ee4a7a
change example
ldecicco-USGS Nov 5, 2024
0b60de4
Another set of multi's
ldecicco-USGS Nov 5, 2024
6146ebb
wqp_check_status example
ldecicco-USGS Nov 5, 2024
722ed47
Trying new GH actions to reduce suggest list, and responding to a few…
ldecicco-USGS Nov 25, 2024
0b30821
Shame, shame, shame! 😔
ldecicco-USGS Nov 25, 2024
1704e18
Meant to include this so we can test if the GH actions work (building…
ldecicco-USGS Nov 25, 2024
29ecfcb
More updates thanks to Joe's review
ldecicco-USGS Nov 25, 2024
9ce4776
Custom .multi for legacy
ldecicco-USGS Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main]
branches: [main, develop]
pull_request:
branches: [main]
branches: [main, develop]

name: R-CMD-check

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ Copyright: This software is in the public domain because it contains materials
Depends:
R (>= 3.5.0)

Choose a reason for hiding this comment

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

For what it's worth, httr2 (and the tidyverse) now require R >= 4.0, and in the spring will require R >= 4.1 . If you bump this to 4.1 (which, depending when you're planning on launching things, will be the minimum version to use the package anyway) then you can use the base pipe, which might make some of the query-building more fluid

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🥳I've been avoiding the 4.1 requirement, but if httr2 has it already....HELLO PIPES

Choose a reason for hiding this comment

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

You could also re-export the magrittr pipe from httr2 (either directly or by adding magrittr as a direct dependency) if this is going out before the spring. Here's how httr2 does it:
https://github.com/r-lib/httr2/blob/main/R/utils-pipe.R

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When magrittr first came out, we very firmly came to the conclusion that we would never use it within a package, so I've very much avoided re-exporting it. However, my understanding is that the base R pipe does a better job of allowing the "traceback" when an error occurs. So, I'm happy to start using native pipes - but would not introduce magittr at this stage of the game.

Imports:
httr (>= 1.0.0),
curl,
lubridate (>= 1.5.0),
stats,
utils,
xml2,
readr (>= 1.4.0),
jsonlite
jsonlite,
httr2
Suggests:
covr,
dplyr,
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dataRetrieval 2.7.18
===================
* Switched from httr to httr2
* Added a way to include a custom user-agent suffix via an enviornmental variable "CUSTOM_DR_UA"

dataRetrieval 2.7.17
Expand Down
Loading
Loading