@@ -38,8 +38,9 @@ cromwellJobs <- function(days = 1, workflowName = NULL, workflowStatus = NULL,
38
38
)
39
39
))$ results
40
40
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" )}
43
44
cromTable $ submission <- lubridate :: with_tz(lubridate :: ymd_hms(cromTable $ submission ), tzone = " US/Pacific" )
44
45
if (" start" %in% colnames(cromTable ) == T ) {
45
46
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,
52
53
} else {
53
54
cromTable <- data.frame (" workflow_id" = NA ,
54
55
stringsAsFactors = F ) }
55
- convertToChar <- c(" submission" , " start" , " end" , " workflwoDuration " )
56
+ convertToChar <- c(" submission" , " start" , " end" , " workflowDuration " )
56
57
theseCols <- colnames(cromTable ) %in% convertToChar
57
58
cromTable [theseCols ] <- lapply(cromTable [theseCols ], as.character )
58
59
return (cromTable )
0 commit comments