Skip to content

Commit

Permalink
Update function so it doesnt stop too early during saving of cache
Browse files Browse the repository at this point in the history
  • Loading branch information
truenomad committed May 23, 2024
1 parent e92a36b commit 2132f53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/prep_geonames.R
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ prep_geonames <- function(target_df, lookup_df = NULL,

# Step 4: clean up the cache file and save -----------------------------------

if (length(as.data.frame(cleaned_dfs)) > 0) {
if (length(cleaned_dfs) > 0 && any(sapply(cleaned_dfs, nrow) > 0)) {
# clean up the cache df
suppressWarnings(
cleaned_cache_joined <- dplyr::bind_rows(cleaned_dfs) |>
Expand Down

0 comments on commit 2132f53

Please sign in to comment.