bug: unbound table error even after setting default_backend
#8677
Labels
bug
Incorrect behavior inside of ibis
unbound table error even after setting default_backend
#8677
What happened?
Executing a query with
ibis.<backend>.execute()throws an error even ifdefault_backendis setCode to replicate the issue:
What version of ibis are you using?
8.0.0
What backend(s) are you using, if any?
DuckDB
Relevant log output
{ "name": "IbisError", "message": "Expression contains unbound tables and therefore cannot be executed. Use ibis.<backend>.execute(expr) or assign a backend instance to `ibis.options.default_backend`.", "stack": "--------------------------------------------------------------------------- IbisError Traceback (most recent call last) Cell In[33], line 24 21 t = ibis.table(name=\"test\", schema=schema) 22 ibis.set_backend(con) 23 q = ( ---> 24 t.select(t) 25 .aggregate(total_sales=_.sales.sum(), by=[_.date, _.product]) 26 .pivot_wider( 27 id_cols=[\"date\"], 28 names_from=\"product\", 29 values_from=[\"total_sales\"], 30 values_agg=\"sum\", 31 ) 32 ) 34 names = q.select(\"product\").distinct() 35 names = con.execute(names)[\"product\"].tolist() File ~/frappe/bench-v13/env/lib/python3.10/site-packages/ibis/expr/types/relations.py:4053, in Table.pivot_wider(self, id_cols, names_from, names_prefix, names_sep, names_sort, names, values_from, values_fill, values_agg) 4049 values_agg = values_agg.resolve 4051 if names is None: 4052 # no names provided, compute them from the data -> 4053 names = self.select(names_from).distinct().execute() 4054 else: 4055 if not (columns := [col.get_name() for col in names_from.expand(self)]): File ~/frappe/bench-v13/env/lib/python3.10/site-packages/ibis/expr/types/core.py:324, in Expr.execute(self, limit, timecontext, params, **kwargs) 297 def execute( 298 self, 299 limit: int | str | None = \"default\", (...) 302 **kwargs: Any, 303 ): 304 \"\"\"Execute an expression against its backend if one exists. 305 306 Parameters (...) 322 Keyword arguments 323 \"\"\" --> 324 return self._find_backend(use_default=True).execute( 325 self, limit=limit, timecontext=timecontext, params=params, **kwargs 326 ) File ~/frappe/bench-v13/env/lib/python3.10/site-packages/ibis/expr/types/core.py:279, in Expr._find_backend(self, use_default) 277 if not backends: 278 if has_unbound: --> 279 raise IbisError( 280 \"Expression contains unbound tables and therefore cannot \" 281 \"be executed. Use ibis.<backend>.execute(expr) or \" 282 \"assign a backend instance to \" 283 \"`ibis.options.default_backend`.\" 284 ) 285 default = _default_backend() if use_default else None 286 if default is None: IbisError: Expression contains unbound tables and therefore cannot be executed. Use ibis.<backend>.execute(expr) or assign a backend instance to `ibis.options.default_backend`." }Code of Conduct
The text was updated successfully, but these errors were encountered: