Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Jun 23, 2024
1 parent 6f619a7 commit 7dcc8af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/dataframe__frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -1763,12 +1763,12 @@ DataFrame_glimpse = function(..., return_as_string = FALSE) {
}

# closure to extract col info from a column in <self>
max_num_value = as.integer(min(10, self$height))
max_num_value = min(10, self$height)
max_col_name_trunc = 50
parse_column_ = \(col_name, dtype) {
dtype_str = dtype_str_repr(dtype) |> unwrap_or(paste0("??", str_string(dtype)))
if (inherits(dtype, "RPolarsDataType")) dtype_str = paste0(" <", dtype_str, ">")
val = self$select(pl$col(col_name)$slice(0L, max_num_value))$to_list()[[1]]
val = self$select(pl$col(col_name)$slice(0, max_num_value))$to_list()[[1]]
val_str = paste(val, collapse = ", ")
if (nchar(col_name) > max_col_name_trunc) {
col_name = paste0(substr(col_name, 1, max_col_name_trunc - 3), "...")
Expand Down

0 comments on commit 7dcc8af

Please sign in to comment.