Skip to content

Commit

Permalink
Use coerce_to_hub_schema instead of hubData:: coerce_to_hub_schema in…
Browse files Browse the repository at this point in the history
…ternally
  • Loading branch information
annakrystalli committed Nov 21, 2024
1 parent d6c3a1d commit 613dcfc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/check_tbl_values_required.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ check_tbl_values_required <- function(tbl, round_id, file_path, hub_path,
if (check) {
details <- NULL
} else {
missing_df <- hubData::coerce_to_hub_schema(missing_df, config_tasks)
missing_df <- coerce_to_hub_schema(missing_df, config_tasks)
details <- cli::format_inline("See {.var missing} attribute for details.")
}

Expand Down
2 changes: 1 addition & 1 deletion R/expand_model_out_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ process_mt_grid_outputs <- function(x, config_tasks, all_character,
} else {
x <- purrr::map(
x,
~ hubData::coerce_to_hub_schema(
~ coerce_to_hub_schema(
.x,
config_tasks,
as_arrow_table = as_arrow_table,
Expand Down
4 changes: 2 additions & 2 deletions R/read_model_out_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ read_model_out_file <- function(file_path, hub_path = ".",
parquet = {
if (coerce_types == "hub") {
arrow::read_parquet(full_path) %>%
hubData::coerce_to_hub_schema(
coerce_to_hub_schema(
config_tasks = read_config(hub_path, "tasks"),
output_type_id_datatype = output_type_id_datatype
)
Expand All @@ -67,7 +67,7 @@ read_model_out_file <- function(file_path, hub_path = ".",
arrow = {
if (coerce_types == "hub") {
arrow::read_feather(full_path) %>%
hubData::coerce_to_hub_schema(
coerce_to_hub_schema(
config_tasks = read_config(hub_path, "tasks"),
output_type_id_datatype = output_type_id_datatype
)
Expand Down
2 changes: 1 addition & 1 deletion R/submission_tmpl.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ submission_tmpl <- function(hub_con, config_tasks, round_id,
# Add NA columns for value and all optional cols
na_cols <- tmpl_cols[!tmpl_cols %in% names(tmpl_df)]
tmpl_df[, na_cols] <- NA
tmpl_df <- hubData::coerce_to_hub_schema(tmpl_df, config_tasks)[, tmpl_cols]
tmpl_df <- coerce_to_hub_schema(tmpl_df, config_tasks)[, tmpl_cols]

if (complete_cases_only) {
subset_complete_cases(tmpl_df)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ create_spl_file <- function(round_id, compound_taskid_set = NULL,
dplyr::filter(.data$output_type == "sample") |>
dplyr::filter(reference_date + lubridate::weeks(horizon) == target_end_date) |>
dplyr::mutate(value = sample.int(n = 1000, size = length(value))) |>
hubData::coerce_to_hub_schema(config_tasks)
coerce_to_hub_schema(config_tasks)

uniq_spl_ids <- unique(tbl$output_type_id)
recode_spl_ids <- seq_along(uniq_spl_ids) |> as.character()
Expand Down

0 comments on commit 613dcfc

Please sign in to comment.