You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When interrogating an agent that is an arrow object, I get the following error: The 'table' in this validation step is not really a table object.
When I convert the arrow dataset to a data.frame first, pointblank works as expected
create_agent(as.data.frame(df)) |> # NOTE the as.data.frame here
col_is_numeric(vars(x)) |>
interrogate()
#> ── Interrogation Started - there is a single validation step ────────────────────────────────────────────────
#> ✔ Step 1: OK.
#> ── Interrogation Completed ──────────────────────────────────────────────────────────────────────────────────
Reproducible example
library(pointblank)
library(arrow)
#> #> Attaching package: 'arrow'#> The following object is masked from 'package:utils':#> #> timestampdf<- arrow_table(x=1:3, y= c("a", "b", "c"))
agent<- create_agent(df) |>
col_is_numeric(vars(x))
agent|> get_agent_report(display_table=FALSE)
#> # A tibble: 1 × 14#> i type columns values precon active eval units n_pass f_pass W S #> <int> <chr> <chr> <chr> <chr> <lgl> <chr> <int> <int> <dbl> <lgl> <lgl>#> 1 1 col_… x <NA> <NA> NA <NA> NA NA NA NA NA #> # … with 2 more variables: N <lgl>, extract <lgl>agent|> interrogate() |> get_agent_report(display_table=FALSE)
#> # A tibble: 1 × 14#> i type columns values precon active eval units n_pass f_pass W S #> <int> <chr> <chr> <chr> <chr> <lgl> <chr> <int> <int> <dbl> <lgl> <lgl>#> 1 1 col_… x <NA> <NA> TRUE ERROR NA NA NA NA NA #> # … with 2 more variables: N <lgl>, extract <int># repeat with a database connection --------------------
write_dataset(df, "arrow-dataset")
ds<- open_dataset("arrow-dataset")
agent<- create_agent(ds) |>
col_is_numeric(vars(x))
agent|> get_agent_report(display_table=FALSE)
#> # A tibble: 1 × 14#> i type columns values precon active eval units n_pass f_pass W S #> <int> <chr> <chr> <chr> <chr> <lgl> <chr> <int> <int> <dbl> <lgl> <lgl>#> 1 1 col_… x <NA> <NA> NA <NA> NA NA NA NA NA #> # … with 2 more variables: N <lgl>, extract <lgl>agent|> interrogate() |> get_agent_report(display_table=FALSE)
#> # A tibble: 1 × 14#> i type columns values precon active eval units n_pass f_pass W S #> <int> <chr> <chr> <chr> <chr> <lgl> <chr> <int> <int> <dbl> <lgl> <lgl>#> 1 1 col_… x <NA> <NA> TRUE ERROR NA NA NA NA NA #> # … with 2 more variables: N <lgl>, extract <int>
FWIW I see this more of a feature request than a bug. Think of arrow as another backend. I think the error message is informative (while not perfect). An arrow dataset is neither a data.frame, nor a database table. So I would expect the current approach not to work. I couldn't find in the {pointblank} documentation a claim that the tbl argument of create_agent() can be an arrow::Table.
As a first suggestion it would be great to have the documentation of the supported backends in a more prominent location (e.g. a paragraph in the {pagedown} site).
A second suggestion: maybe, in a first instance, error with a clear message that arrow tables (or datasets, etc.) are not (yet) supported and have a follow-up issue to implement such support arrow inputs? (I have done some work on {arrow} in the past and I think this might not be a trivial endeavour).
(by the way, thanks a lot for the great package and for the R in Pharma workshop)
Prework
Description
When interrogating an agent that is an arrow object, I get the following error:
The 'table' in this validation step is not really a table object.
When I convert the arrow dataset to a data.frame first, pointblank works as expected
Reproducible example
Created on 2023-04-17 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: