Skip to content

Commit

Permalink
Merge pull request #46 from getwilds/cosmetics
Browse files Browse the repository at this point in the history
Minor improvements to jobs and call fxns
  • Loading branch information
tefirman authored Aug 8, 2024
2 parents 4c3a210 + 3d38856 commit 968d0ad
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rcromwell
Title: Convenience Tools for Managing WDL Workflows via Cromwell
Version: 3.2.4
Version: 3.2.4.9200
Authors@R: c(
person("Amy", "Paguirigan", role = "aut",
comment = c(ORCID = "0000-0002-6819-9736")),
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export(cw_url)
export(workflow_inputs)
export(workflow_options)
importFrom(dplyr,"%>%")
importFrom(dplyr,any_of)
importFrom(dplyr,as_tibble)
importFrom(dplyr,relocate)
importFrom(dplyr,tibble)
importFrom(glue,glue)
importFrom(httr,GET)
Expand Down
2 changes: 1 addition & 1 deletion R/cromwellCall.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@ cromwell_call <- function(workflow_id, url = cw_url(), token = NULL) {
# with Shiny apps easier
just_calls <- dplyr::tibble("workflow_id" = "No call metadata available.")
}
return(just_calls)
return(dplyr::as_tibble(just_calls))
}
# nolint end
5 changes: 5 additions & 0 deletions R/cromwellJobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@ cromwell_jobs_process <- function(jobs_data) {
} else {
cr_table <- dplyr::tibble("workflow_id" = NA)
}

# specific column order if columns exist (via `any_of`)
columns_order <- c("workflow_name", "workflow_id", "status", "submission", "start",
"end", "workflowDuration")
cr_table <- dplyr::relocate(cr_table, any_of(columns_order))
return(cr_table)
}
2 changes: 1 addition & 1 deletion R/rcromwell-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## usethis namespace: start
#' @importFrom glue glue
#' @importFrom dplyr as_tibble tibble %>%
#' @importFrom dplyr as_tibble tibble relocate any_of %>%
#' @importFrom lubridate now with_tz ymd_hms
#' @importFrom purrr discard flatten keep map map_dfr pluck reduce
## usethis namespace: end
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-cromwell_call.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ test_that("cromwell_call", {
})

expect_s3_class(res, "data.frame")
expect_s3_class(res, "tbl")
expect_equal(res$callName, "hello")
})
3 changes: 3 additions & 0 deletions tests/testthat/test-cromwell_jobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ test_that("cromwell_jobs", {
match_requests_on = c("method", "host", "path")
)

expect_s3_class(res, "data.frame")
expect_s3_class(res, "tbl")
expect_equal(NCOL(res), 8)
# explicit column ordering for better understanding
expect_equal(names(res)[1], "workflow_name")
})

0 comments on commit 968d0ad

Please sign in to comment.