R-ArcGIS/arcgislayers

`multi_req_perform()` deprecated in httr2 0.3.0

Closed this issue · 5 comments

I accessed a layer using arc_select() and encountered a warning message that multi_req_perform() was deprecated in httr2 0.3.0 and the recommendation to use req_perform_parallel() instead.

library(arcgislayers)

url <- "https://services1.arcgis.com/UWYHeuuJISiGmgXx/arcgis/rest/services/Police_District/FeatureServer/0"

url |> 
  arc_open() |> 
  arc_select()
#> Warning: `multi_req_perform()` was deprecated in httr2 0.3.0.
#> ℹ Please use `req_perform_parallel()` instead.
#> ℹ The deprecated feature was likely used in the arcgislayers package.
#>   Please report the issue to the authors.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Simple feature collection with 9 features and 10 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 1393954 ymin: 557730.8 xmax: 1445504 ymax: 621403.9
#> Projected CRS: NAD83 / Maryland (ftUS)
#>   OBJECTID DistrictNumber Dist_Abbr     Dist_Alt    Dist_Name DistrictName
#> 1        1              8       SWD SOUTHWESTERN Southwestern Southwestern
#> 2        2              9        SD     SOUTHERN     Southern     Southern
#> 3        3              7        WD      WESTERN      Western      Western
#> 4        4              5        ND     NORTHERN     Northern     Northern
#> 5        5              3        ED      EASTERN      Eastern      Eastern
#> 6        6              4       NED NORTHEASTERN Northeastern Northeastern
#> 7        7              2       SED SOUTHEASTERN Southeastern Southeastern
#> 8        8              1        CD      CENTRAL      Central      Central
#> 9        9              6       NWD NORTHWESTERN Northwestern Northwestern
#>   District Shape__Area Shape__Length                             GlobalID
#> 1        8   178754019      71105.63 384f5737-4505-4cfd-9acf-14927828172d
#> 2        9   415611184     318186.65 93cec04b-0f68-4636-bd18-d97c265d5c2b
#> 3        7   103376993      47297.63 340e9962-6da4-48bb-9492-8786cc4dab9f
#> 4        5   335829135      97104.82 b048844d-fc52-454b-b3b8-ada965dad1aa
#> 5        3   151361282      70029.84 f59df681-1bf4-403b-bef7-19b1c81cb4b9
#> 6        4   373905081      94559.16 368f4681-a8c7-4c48-a95a-bfa705fd5206
#> 7        2   274871367     159729.08 892acfb1-6138-4c6d-8d7c-3433470ba411
#> 8        1    82660231      84247.61 7defd6a2-f515-4d79-8f90-5a2b1d8cafb8
#> 9        6   355731472     107357.28 b487215a-1dad-4c9c-8453-f68f7a0a0bfc
#>                         geometry
#> 1 MULTIPOLYGON (((1400480 583...
#> 2 MULTIPOLYGON (((1433443 565...
#> 3 MULTIPOLYGON (((1410903 592...
#> 4 MULTIPOLYGON (((1419782 598...
#> 5 MULTIPOLYGON (((1434850 593...
#> 6 MULTIPOLYGON (((1442785 600...
#> 7 MULTIPOLYGON (((1444616 573...
#> 8 MULTIPOLYGON (((1424639 585...
#> 9 MULTIPOLYGON (((1404965 592...

Created on 2023-11-10 with reprex v2.0.2

Let me know if you want a hand with this and I'd be happy to open a pull request within the next week or so.

httr2 version 3.0 is not released yet fortunately! So we have some time. Really frustrating since I just published {arcpbf} yesterday based on the current released version of httr2! Lol

This will need to be addressed once a new release makes it to CRAN. Right now I do not want to refactor the entire package to check the name.

An alternative would be to create a wrapper function that uses multi_req_perform() or req_perform_parallel() conditional upon the version of the package being used.

r-lib/httr2#376

I honestly forgot that I was running a development version of {httr2}. Your multi_req_perform() style function for {arcpbf} was the first thing I thought of when I saw the message! No rush on my end but figured you'd want the heads up.

Well that was fast. {httr2} v1.0.0 is out now! Got to do this.

Fixed in #98