Skip to content

Commit 46aa651

Browse files
Cole ChuchmachCole Chuchmach
authored andcommitted
v0.7.8 - SQLite files will be deleted if the user asked for CSV or RDS output
1 parent 3bdc1ee commit 46aa651

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: datastan
22
Type: Package
33
Title: Minimizing Linkage Response Time with User Friendly Standardizing Functions and Applications
4-
Version: 0.7.7
4+
Version: 0.7.8
55
Authors@R: c(
66
person(given=c("Cole", "D."), family="Chuchmach", email="Cole.Chuchmach@umanitoba.ca", role=c("aut", "cre")),
77
person(given=c("Barret", "A."), family="Monchka", email="Barret.Monchka@umanitoba.ca", role="aut")

R/data_standardization_script.R

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2950,11 +2950,25 @@ standardize_data <- function(input_file_path, input_dataset_code, input_flags, o
29502950
clean_db_conn <- dbConnect(RSQLite::SQLite(), clean_file_path)
29512951
df <- dbReadTable(clean_db_conn, 'clean_data_table')
29522952
dbDisconnect(clean_db_conn)
2953+
2954+
# If file output is not sqlite, remove it
2955+
output_type <- flag_lookup["file_output"]
2956+
if(output_type != "sqlite"){
2957+
print(paste0("Removing SQLite File: ", clean_file_path))
2958+
file.remove(clean_file_path)
2959+
}
2960+
29532961
return(df)
29542962
}
29552963
else{
2964+
# If file output is not sqlite, remove it
2965+
output_type <- flag_lookup["file_output"]
2966+
if(output_type != "sqlite"){
2967+
print(paste0("Removing SQLite File: ", clean_file_path))
2968+
file.remove(clean_file_path)
2969+
}
2970+
29562971
print("File is too large to open and return, or a maximum file size was not provided.")
29572972
return(data.frame())
29582973
}
2959-
29602974
}

0 commit comments

Comments
 (0)