Missing dataframe in as.db.data.frame error not specific
Opened this issue · 2 comments
dotcomken commented
The current error as shown in R:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘as.db.data.frame’ for signature ‘"function
While debugging the error using as.db.data.frame I learned the dataframe I was using was not in the environment. Would suggest making this error more specific to missing data.
fmcquillan99 commented
Thanks, we will update the error message to be clearer.
orhankislal commented
@dotcomken Could you give the steps to repro this issue? I tried a very simple case of missing data frame but it gives a different error.
> n = c(2, 3, 5)
> s = c("aa", "bb", "cc")
> b = c(TRUE, FALSE, TRUE)
> df = data.frame(n, s, b)
> w <- as.db.data.frame(df, "df_from_r", conn_id = 1)
Counting and caching the data table dimension ... 0.009 sec ... done.
An R object pointing to "df_from_r" in connection 1 is created !
The data in the data.frame df is stored into "df_from_r" in database madlib-pg94 on 127.0.0.1 !
> w <- as.db.data.frame(df2, "df_from_r2", conn_id = 1)
Error in as.db.data.frame(df2, "df_from_r2", conn_id = 1) :
object 'df2' not found