Skip to content

Commit

Permalink
fix metadata stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencarlislewalker committed Feb 29, 2024
1 parent 849fd76 commit 4be3412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/iidda/R/data_frame_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ fix_csv = function(filename) {
initial_guess = readr::read_csv(filename, col_types = "c")
write_data_frame(initial_guess, tmp_file)
best_guess = read_data_frame(tmp_file)
current_read = read_data_frame(filename)
current_read = try(read_data_frame(filename), silent = TRUE)
need_to_fix = !identical(best_guess, current_read)
if (need_to_fix) {
file.copy(tmp_file, filename, overwrite = TRUE)
message("CSV is fixed! Please check to make sure that your expectations are met.")
} else {
message("CSV file did not need fixing")
Expand Down
4 changes: 3 additions & 1 deletion R/iidda/R/metadata_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ read_tracking_tables = function(path) {
"notes", "source", "years", "start_date", "end_date", "frequency",
"breakdown", "urls", "date_of_url_access", "tidy_dataset", "path_prep_script",
"path_tidy_data", "publisher", "publicationYear", "current_version",
"staging_url_prefix", "scan", "access_script", "prep_script"
"staging_url_prefix", "scan", "access_script", "prep_script", "digitization_priority",
"data_type", "name", "description", "web_resource"
)
paths = file.path(path, list.files(path, pattern = '.csv'))
output = (paths
Expand All @@ -32,6 +33,7 @@ read_tracking_tables = function(path) {
warning(warn_msg)
}
}
return(output)
}

#' Read Tracking Metadata
Expand Down

0 comments on commit 4be3412

Please sign in to comment.