Skip to content

Commit

Permalink
removing dropbox refresh function. this can be done within the users …
Browse files Browse the repository at this point in the history
…targets workflow
  • Loading branch information
deanmarchiori committed Apr 16, 2024
1 parent 8317435 commit 4c7b0ed
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 57 deletions.
6 changes: 2 additions & 4 deletions R/download_dropbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#' @seealso [rdrop2::drop_download()]
#' @examples
#' \dontrun{
#' download_dropbox(dropbox_path = "DTRA_RVF2/RVF Mosquito Datasets",
#' dropbox_filename = "Mosquito dataset as at 01-02-2024.xlsx",
#' download_dropbox(dropbox_path = "XYZ/Project-Datasets",
#' dropbox_filename = "Project dataset as at 01-02-2024.xlsx",
#' download_path = here::here("data"),
#' overwrite = TRUE)
#' }
Expand All @@ -23,8 +23,6 @@ download_dropbox <-
dropbox_filename,
download_path,
...) {
# locate and update token
refresh_db_token()

# check if exists
if (!rdrop2::drop_exists(paste(dropbox_path, dropbox_filename, sep = "/"))) {
Expand Down
23 changes: 0 additions & 23 deletions R/dropbox_refresh.R

This file was deleted.

7 changes: 2 additions & 5 deletions R/dropbox_upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@
#' \dontrun{
#' dropbox_upload(
#' kzn_animal_ship_semiclean,
#' file_path = here::here("outputs/kzn_animal_ship_semiclean.csv"),
#' dropbox_path = "DTRA_RVF2/Data/rvf2_github_data/semi_clean_data"
#' file_path = here::here("outputs/data.csv"),
#' dropbox_path = "XYZ/Data/semi_clean_data"
#' )
#' }
#'
dropbox_upload <- function(log, file_path, dropbox_path) {
log_export <- readr::write_csv(log, file_path)

# upload token
refresh_db_token()

# upload
rdrop2::drop_upload(file_path, dropbox_path)

Expand Down
5 changes: 2 additions & 3 deletions R/get_dropbox_val_logs.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
#' @export
#' @examples
#' \dontrun{
#' get_dropbox_val_logs(file_name = "log_levellogger.csv", folder = NULL)
#' get_dropbox_val_logs(file_name = "log.csv", folder = NULL)
#' }
#'
get_dropbox_val_logs <-
function(file_name, folder, path_name = "DTRA_RVF2/Data/rvf2_github_data/validation_logs") {
refresh_db_token()
function(file_name, folder, path_name) {

# path handling when log isnt in a dedicated subfolder on drop box
if (is.null(folder)) {
Expand Down
22 changes: 0 additions & 22 deletions man/refresh_db_token.Rd

This file was deleted.

0 comments on commit 4c7b0ed

Please sign in to comment.