-
Notifications
You must be signed in to change notification settings - Fork 685
Open
Labels
featureFeatures or general enhancementsFeatures or general enhancements
Description
What is the motivation behind your request?
I write data manipulation backend agnostic functions which take a table input and do the computation. The problem is that there is no lightweight way to wrap an existing object (ex. polars) into ibis.Table object.
Currently the only way seems to be the memtable which has two "issues":
- it relies on the global backend declaration and
- seems to be performing coercions (data duplication) under the hood even when the backend is the same (I am not completely sure about this one)
import polars as pl
import ibis
df = pl.DataFrame({
"column1": [1, 2, 3],
"column2": ["a", "b", "c"]
})
ibis.memtable(df).get_backend()
## <ibis.backends.duckdb.Backend at 0x13e7ece90>
ibis.set_backend("polars")
tt = ibis.memtable(df)
df is tt.to_polars()
## FalseDescribe the solution you'd like
I would like to have a lightweight ibis.wrap function which would take an object of the supported backend (ex. polars, pyarrow etc) and automatically wrap it into the corresponding backend in the most lightweight way possible, ideally without any conversions by keeping track of the reference of the original object.
What version of ibis are you running?
10.5.0
What backend(s) are you using, if any?
polars 1.27.1
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
featureFeatures or general enhancementsFeatures or general enhancements
Type
Projects
Status
backlog