Skip to content

Commit

Permalink
Handle missing server value in getTemporalData
Browse files Browse the repository at this point in the history
  • Loading branch information
Gennadiy Anisimov committed Apr 2, 2024
1 parent 5fdd05c commit c7cd126
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/getTemporalData.r
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ getTemporalData <- function(connectionDetails,
analysisIdGiven <- FALSE
}

if (typeof(connectionDetails$server) == "character")
dbName <- toupper(strsplit(connectionDetails$server,
"/")[[1]][2]) else dbName <- toupper(strsplit(connectionDetails$server(), "/")[[1]][2])
if (typeof(connectionDetails$server) == "character") {
dbName <- toupper(strsplit(connectionDetails$server, "/")[[1]][2])
} else if (typeof(connectionDetails$server()) == "character") {
dbName <- toupper(strsplit(connectionDetails$server(), "/")[[1]][2])

Check warning on line 99 in R/getTemporalData.r

View check run for this annotation

Codecov / codecov/patch

R/getTemporalData.r#L96-L99

Added lines #L96 - L99 were not covered by tests
} else {
dbName <- NA

Check warning on line 101 in R/getTemporalData.r

View check run for this annotation

Codecov / codecov/patch

R/getTemporalData.r#L101

Added line #L101 was not covered by tests
}

translatedSql <- SqlRender::loadRenderTranslateSql(sqlFilename = "temporal/achilles_temporal_data.sql",
packageName = "Achilles", dbms = connectionDetails$dbms, db_name = dbName, cdm_schema = cdmDatabaseSchema,
Expand Down

0 comments on commit c7cd126

Please sign in to comment.