Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(app): #182 move directory creation later #224

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions run_pacta_data_preparation.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ config[["data_prep_outputs_path"]] <- file.path(
paste(config[["pacta_financial_timestamp"]], system_timestamp, sep = "_")
)

if (dir.exists(config[["data_prep_outputs_path"]])) {
logger::log_warn("POTENTIAL DATA LOSS: Output directory already exists, and files may be overwritten ({config[[\"data_prep_outputs_path\"]]}).")
warning("Output directory exists. Files may be overwritten.")
} else {
logger::log_trace("Creating output directory: \"{config[[\"data_prep_outputs_path\"]]}\"")
dir.create(config[["data_prep_outputs_path"]], recursive = TRUE)
}


# input filepaths --------------------------------------------------------------

masterdata_ownership_path <-
Expand Down Expand Up @@ -300,6 +291,16 @@ saveRDS(currencies, currencies_data_path)
logger::log_info("Saving file: \"index_regions.rds\".")
saveRDS(index_regions, index_regions_data_path)

# Create output directory ---------------------------------------------------------

if (dir.exists(config[["data_prep_outputs_path"]])) {
logger::log_warn("POTENTIAL DATA LOSS: Output directory already exists, and files may be overwritten ({config[[\"data_prep_outputs_path\"]]}).")
warning("Output directory exists. Files may be overwritten.")
} else {
logger::log_trace("Creating output directory: \"{config[[\"data_prep_outputs_path\"]]}\"")
dir.create(config[["data_prep_outputs_path"]], recursive = TRUE)
}


# financial data output --------------------------------------------------------

Expand Down