I might have been chasing a red herring, but when I dug into this, I found that expand_model_out_grid() does not create a grid when there are no output_task_ids to expand.
This function is expected to take a list of required task IDs and a list of required output type IDs and return a data frame that contains the expansion of both.
The problem comes when there are no required output type ids (e.g. in the default case where we are not expanding sample output type ids). If I add a catch before this to return just the expanded task ID table, then the submission is correctly invalidated, BUT there are few tests that subsequently fail due to bad joins.
# Function that expands modeling task level lists of task IDs and output type
# values into a grid and combines them into a single tibble.
expand_output_type_grid <- function(task_id_values,
output_type_values) {
+ if (length(output_type_values) == 0) {
+ return(expand.grid(purrr::compact(task_id_values), stringsAsFactors = FALSE)))
+ }
purrr::imap(
output_type_values,
~ c(task_id_values, list(
output_type = .y,
output_type_id = .x
)) %>%
purrr::compact() %>%
expand.grid(stringsAsFactors = FALSE)
) %>%
purrr::list_rbind()
}
An issue was found in https://github.com/reichlab/variant-nowcast-hub/issues/83, which is tested in https://github.com/reichlab/variant-nowcast-hub/pull/90 where
check_tbl_values_required()
does not invalidate the submission when required task ID values are missing in a hub that is taking sample data.There are supposed to be specific clades in the task IDs
There are several clades missing in the submission file
The checks succeed regardless
Created on 2024-10-02 with reprex v2.1.1
Analysis
I might have been chasing a red herring, but when I dug into this, I found that
expand_model_out_grid()
does not create a grid when there are nooutput_task_id
s to expand.This function is expected to take a list of required task IDs and a list of required output type IDs and return a data frame that contains the expansion of both.
https://github.com/hubverse-org/hubValidations/blob/85d58251c7cbcbb4064a72f8126ad8846f351dbd/R/expand_model_out_grid.R#L245-L259
The problem comes when there are no required output type ids (e.g. in the default case where we are not expanding sample output type ids). If I add a catch before this to return just the expanded task ID table, then the submission is correctly invalidated, BUT there are few tests that subsequently fail due to bad joins.