From c170a387e65d65f68433cc2836e9bdd35c17ce4c Mon Sep 17 00:00:00 2001 From: Raven Bot Date: Thu, 14 Mar 2024 12:01:49 -0400 Subject: [PATCH] check and fix return of tracker statuses --- R/interface_sheets.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/interface_sheets.R b/R/interface_sheets.R index d6d8412..2eed221 100644 --- a/R/interface_sheets.R +++ b/R/interface_sheets.R @@ -19,8 +19,11 @@ read_db_units <- function(id = getOption("gdrv_auto_env.URL_db_units")) #' @export read_tracker_statuses <- function(url, sheet = "unit 1") { - googlesheets4::read_sheet(url, sheet, skip = 1, trim_ws = FALSE) %>% + statuses_colnames <- c("Unit", "Mini-Unit", "Phase", "Task", "Signoff by", "Status") + result <- googlesheets4::read_sheet(url, sheet, skip = 1, trim_ws = FALSE) %>% as_statuses() + stopifnot(identical(names(results), statuses_colnames)) + dplyr::select(result, statuses_colnames) } #' Update the tracker data