-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Maybe tblcheck should include some special handling for remote database tables. Here's a smaller example based on the Introduction to dbplyr • dbplyr:
library(dplyr)
con <- DBI::dbConnect(RSQLite::SQLite(), dbname = ":memory:")
copy_to(con, nycflights13::flights[1:100, ], "flights",
temporary = FALSE,
indexes = list(
c("year", "month", "day"),
"carrier",
"tailnum",
"dest"
)
)Given a remote database table, flights_db, tbl_grade() errors because the expected object is not a data.frame.
flights_db <- tbl(con, "flights")
tblcheck::tbl_grade(flights_db, flights_db)
#> An error occurred in the grading code: Assertion on 'expected' failed: Must be of type 'data.frame', not 'tbl_SQLiteConnection/tbl_dbi/tbl_sql/tbl_lazy/tbl'.
#> <gradethis_graded: [Neutral]
#> Uh-oh! We can't provide feedback at this time. Don't worry, it's not
#> your fault! There's an issue behind-the-scenes with this exercise.
#> >For now authors can collect(.result) and collect(.solution), but maybe tbl_grade() could handle this automatically. Alternatively, we could think about rendering the lazy tbl to SQL or doing something else to avoid having to collect the complete data...
flights <- collect(flights_db)
tblcheck::tbl_grade(flights, flights)Metadata
Metadata
Assignees
Labels
No labels