Thoughts on an Ibis feature… it’s often useful to create a table from a pandas DF, but any inferred schema may not be perfect. But assistance with inferring is useful.
The con.create_table does not support the obj param as a pandas DF
if it did, it executes the SQL rather than return an expression - I’m thinking it would be nice if the return was an expression I could .compile() or .execute().
so create_table doesn’t infer from a DF, and load_table lets the DB infer if the table does not exist
I found a path which can infer the ibis schema from a DF, but it’s a bit convoluted
To illustrate the problem, that declare the column as a BIGINT (yes, there are other ways around that)
the way we might use such a feature is to call the function to print the inferred schema sql, then copy the sql, manually adjust it, and execute that directly. I know create_table has some parameters for with, but I don't know if it can handle all options that raw create table sql can do, so I tend to revert to raw sql for that.
from MikeH