Skip to content

Commit

Permalink
update collect_fields() to filter out entries with stored = FALSE (#…
Browse files Browse the repository at this point in the history
…248)

This issue is largely addressed by changes discussed in AtlasOfLivingAustralia/biocache-service#930
  • Loading branch information
mjwestgate committed Feb 3, 2025
1 parent 598bd97 commit 611e172
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/collect_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ collect_fields <- function(.query){
if(!is.null(.query$url)){ # i.e. there is no cached `tibble`
result <- query_API(.query) |>
bind_rows()
# if there is a 'stored' field, use it to filter results
if(any(colnames(result) == "stored")){
result <- result |> dplyr::filter(stored == TRUE)
}
# now mutate to required format
result <- result |>
mutate(id = result$name) |>
select(all_of(wanted_columns("fields"))) |>
Expand Down

0 comments on commit 611e172

Please sign in to comment.