Skip to content

Commit

Permalink
Small adjustments in one helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Aug 18, 2023
1 parent 21fee2e commit 407f83e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apis/r/R/utils-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ check_arrow_pointers <- function(arrlst) {
#' @noRd
extract_levels <- function(arrtbl) {
stopifnot("Argument must be an Arrow Table object" = is_arrow_table(arrtbl))
nm <- names(AT) # we go over the table column by column
nm <- names(arrtbl) # we go over the table column by column
reslst <- vector(mode = "list", length = length(nm))
names(reslst) <- nm # and fill a named list, entries default to NULL
for (n in nm) {
if (inherits(infer_type(arrtbl[[n]]), "DictionaryType")) {
if (inherits(arrow::infer_type(arrtbl[[n]]), "DictionaryType")) {
# levels() extracts the enumeration levels from the factor vector we have
reslst[[n]] <- levels(arrtbl[[n]]$as_vector())
}
Expand Down

0 comments on commit 407f83e

Please sign in to comment.