Skip to content

Commit

Permalink
fix(Logger): Write catalog to logs if it is supported by the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Jul 26, 2024
1 parent 4117f63 commit af34eb8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions R/Logger.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,18 @@ Logger <- R6::R6Class(
assert_timestamp_like(self$start_time, add = coll)
checkmate::reportAssertions(coll)

patch <- purrr::pluck(private$db_table, "name") |>
tibble::enframe() |>
tidyr::pivot_wider() |>
dplyr::mutate(log_file = self$log_filename) |>
patch <- data.frame(
log_file = self$log_filename,
schema = purrr::pluck(private$db_table, "name", "schema"),
table = purrr::pluck(private$db_table, "name", "table")
)

# Add catalog if it exists in the Id
if ("catalog" %in% purrr::pluck(private$db_table, "name", names)) {
patch <- dplyr::mutate(patch, catalog = purrr::pluck(private$db_table, "name", "catalog"), .before = "schema")
}

patch <- patch |>
dplyr::copy_to(
dest = private$log_conn,
df = _,
Expand Down

0 comments on commit af34eb8

Please sign in to comment.