Skip to content

Commit

Permalink
Minor fix to avoid crapping out if rewriting a missing Dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
jrawbits committed May 11, 2020
1 parent 316cfa9 commit c4d7c4e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sources/framework/visioneval/R/datastore.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ listDatastoreRD <- function(DataListing_ls = NULL) {
TRUE
}


#INITIALIZE DATASTORE
#====================
#' Initialize Datastore for an RData (RD) type datastore.
Expand Down Expand Up @@ -397,6 +396,14 @@ writeToTableRD <- function(Data_, Spec_ls, Group, Index = NULL) {
Table <- Spec_ls$TABLE
#Check that dataset exists to write to and attempt to create if not
DatasetExists <- checkDataset(Name, Table, Group, G$Datastore)
if ( DatasetExists ) {
# check for actual file, in case datset listing is obsolete
# It is fine to re-write a missing file
DatasetName <- paste0(Name, ".Rda")
DatasetPath <- file.path(G$DatastoreName, Group, Table, DatasetName)
DatasetExists <- file.exists(DatasetPath)
}

if (!DatasetExists) {
GroupName <- paste(Group, Spec_ls$TABLE, sep = "/")
Length <-
Expand Down

0 comments on commit c4d7c4e

Please sign in to comment.