Hi The code above generates the error in in Rstudio markdown as you can see in the screen shot. However it does not generate the error in the console when you paste it in. The code uses httr2.
it seems like the errors are happening in the markdown and not in R.
Here is a function that generates the error inconsistently.
ClientReportingQuery <- function(query,location) {
request_body <- data.frame(query = c(query))
URL_pbi_append <- paste("datasets",dataset %>%
filter(Location == location) %>%
.$dataset,"executeQueries",sep = "/")results <- req_pbi %>%
req_url_path_append(URL_pbi_append) %>%
req_body_json(list(queries = request_body),auto_unbox = TRUE)%>%
req_perform() %>%
resp_body_json(simplifyVector = FALSE) %>%
pluck("results",1,"tables",1,"rows") %>%
enframe() %>%
unnest_wider(value) %>%
select(-name) %>%
rename_with(~str_extract(.,pattern = "(?<=\[).*(?=\])")) %>%
rename_with(make.names)results
}
