Skip to content

Commit b143dbf

Browse files
committed
repair when your first job fails
1 parent 8043bdb commit b143dbf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: fh.wdlR
22
Title: Convenience Tools for Managing WDL Workflows via Cromwell
3-
Version: 2.0.0
3+
Version: 2.0.1
44
Authors@R:
55
person(given = "Amy",
66
family = "Paguirigan",

R/cromwellJobs.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ cromwellJobs <- function(days = 1, workflowName = NULL, workflowStatus = NULL,
3838
)
3939
))$results
4040
cromTable <- purrr::map_dfr(cromDat, dplyr::bind_rows)
41-
if (nrow(cromTable) > 0) {
42-
cromTable <- dplyr::rename(cromTable, "workflow_id" = "id", "workflowName" = "name")
41+
if (nrow(cromTable) > 0 & "id" %in% names(cromTable)) {
42+
cromTable <- dplyr::rename(cromTable, "workflow_id" = "id")
43+
if ("name" %in% colnames(cromTable)) {cromTable <- dplyr::rename(cromTable, "workflowName" = "name")}
4344
cromTable$submission <- lubridate::with_tz(lubridate::ymd_hms(cromTable$submission), tzone = "US/Pacific")
4445
if ("start" %in% colnames(cromTable) == T) {
4546
cromTable$start <- lubridate::with_tz(lubridate::ymd_hms(cromTable$start), tzone = "US/Pacific") }
@@ -52,7 +53,7 @@ cromwellJobs <- function(days = 1, workflowName = NULL, workflowStatus = NULL,
5253
} else {
5354
cromTable <- data.frame("workflow_id" = NA,
5455
stringsAsFactors = F) }
55-
convertToChar <- c("submission", "start", "end", "workflwoDuration")
56+
convertToChar <- c("submission", "start", "end", "workflowDuration")
5657
theseCols <- colnames(cromTable) %in% convertToChar
5758
cromTable[theseCols] <- lapply(cromTable[theseCols], as.character)
5859
return(cromTable)

0 commit comments

Comments
 (0)