USAID-OHA-SI / grabr

OHA/SI APIs package
https://usaid-oha-si.github.io/grabr/
Other
1 stars 2 forks source link

Bug with stringr when running s3_objects #19

Closed achafetz closed 1 year ago

achafetz commented 1 year ago

Ran into a stringr error when trying to pull down the latest HFR submissions (Wavelength::identify_newfiles()).

image

This is coming from s3_objects, which calls on s3_unpack_keys to unpack the object.

https://github.com/USAID-OHA-SI/grabr/blob/f3fa2184224487946405f08df1e9e8b17ad5c4f4/R/import_s3objects.R#L154-L157

achafetz commented 1 year ago

They may be an issue with the dplyr update to v1.1.0.

Rather than using dplyr::sym({{data_route}} I think we can now drop the sum. The updated code would simply look like

      data_route <- s3_paths[5]
      data_object <- s3_paths[6]

      df_objects <- df_objects %>%
        dplyr::filter(
          !stringr::str_detect(data_route, "^[.]"),
          !stringr::str_detect(data_object, "^[.]")

I couldn't find any paths starting with a ., but I tested by replacing . with archive and the filter seemed to work as expected.