ibis icon indicating copy to clipboard operation
ibis copied to clipboard

feat: make `name` param optional to create_table()

Open NickCrews opened this issue 6 months ago • 4 comments

Sometimes, I just need to load some temp data into a backend, but I don't care what the table name is. now conn.create_table(obj=data, temp=True) is a nice short way to do that.

NickCrews avatar May 28 '25 23:05 NickCrews

Any reason you can't use ibis.memtable for this?

cpcloud avatar Jun 01 '25 15:06 cpcloud

Yes, if obj already is a memtable. .cache() on it doesn't work because you can't choose the backend.

NickCrews avatar Jun 01 '25 19:06 NickCrews

I'm not sure we ever discussed this, but what about a con.memtable method, allowing you to choose which backend a memtable goes into, which would allow .cache() to make sense.

cpcloud avatar Jun 02 '25 19:06 cpcloud

Instead of con.memtable(obj), I would rather just do conn.create_table(obj, temp=True), which I think is more explicit and more familiar.

I think one of the best features of memtables is that they are not bound to a backend. One of the uses for this is in tests. Eg define a memtable with some test data and then create temp tables for this in several different backends (eg to ensure that the feature works across backends).

NickCrews avatar Jun 02 '25 20:06 NickCrews