Skip to content

Completion data frame preview too eager with altrep columns #14121

Open

Description

@romainfrancois

Consider this code example from duckplyr:

library(duckplyr)

out <-
  palmerpenguins::penguins %>%
  # CAVEAT: factor columns are not supported yet
  mutate(across(where(is.factor), as.character)) %>%
  as_duckplyr_df() %>%
  mutate(bill_area = bill_length_mm * bill_depth_mm) %>%
  summarize(.by = c(species, sex), mean_bill_area = mean(bill_area)) %>%
  filter(species != "Gentoo")

The columns from the out data frame are altrep variable that haven't been materialized yet, i.e.

> .Internal(inspect(out))
@144935ea8 19 VECSXP g0c3 [OBJ,REF(2),ATT] (len=3, tl=0)
  @14221e840 16 STRSXP g0c0 [REF(4)] DUCKDB_ALTREP_REL_VECTOR species (VARCHAR)
  @14221eaa8 16 STRSXP g0c0 [REF(4)] DUCKDB_ALTREP_REL_VECTOR sex (VARCHAR)
  @14221ed10 14 REALSXP g0c0 [REF(4)] DUCKDB_ALTREP_REL_VECTOR mean_bill_area (DOUBLE)
ATTRIB:
  [...]

but the preview that may be triggered for auto complete purposes will trigger materialization. Perhaps there should be a way to opt out of the table view, or avoid to materialize altreo columns ...

image

Activity

  1. added
    new
    on Jan 12, 2024
  2. ronblum commented on Jan 16, 2024

    @ronblum
    Contributor

    Hi @romainfrancois!

    Marking for triage review.

  3. added
    autocompletion
    and removed
    new
    on Jan 16, 2024
  4. added this to the Product Backlog milestone on Jan 22, 2024
  5. TimTaylor commented on May 30, 2025

    @TimTaylor

    Any chance of bumping this? duckplyr now errors by default if you try to materialize the following:

    base_url <- "https://blobs.duckdb.org/flight-data-partitioned/Year=2024/data_0.parquet"
    flights_parquet <- duckplyr::read_parquet_duckdb(base_url)
    

    Image.

  6. kevinushey commented on Feb 24, 2026

    @kevinushey
    Collaborator

    FWIW I see this when I try to run the example code:

    > flights_parquet <- duckplyr::read_parquet_duckdb(base_url)
    Error in `duckfun()` at duckplyr/R/read_file_duckdb.R:57:3:
    ! {"exception_type":"Extension Autoloading","exception_message":"An error occurred while trying to automatically install the required extension 'httpfs':\nExtension \"/Users/kevin/Library/Application Support/org.R-project.R/R/duckdb/extensions/v1.4.4/osx_arm64/httpfs.duckdb_extension\" not found.\nExtension \"httpfs\" is an existing extension.\n\nInstall it first using \"INSTALL httpfs\"."}
    Run `rlang::last_trace()` to see where the error occurred.
    

    Resolved that with:

    duckplyr::db_exec("INSTALL httpfs")
    

    I think the error here specifically occurs when we try to generate the data.frame preview in the Help popup for the autocompletion system.

  7. TimTaylor commented on Feb 25, 2026

    @TimTaylor
    duckplyr::db_exec("INSTALL httpfs")
    

    😅 Glad you found! Sure I'd of been scratching around for a while trying to remember that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autocompletionbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions