diff --git a/ibis/backends/base/__init__.py b/ibis/backends/base/__init__.py index 2041a54b73a5..d0aed452420b 100644 --- a/ibis/backends/base/__init__.py +++ b/ibis/backends/base/__init__.py @@ -1186,9 +1186,9 @@ def _cached(self, expr: ir.Table): if (result := self._query_cache.get(op)) is None: self._query_cache.store(expr) result = self._query_cache[op] - return ir.CachedTable(result) + return ir.CachedTableExpr(result) - def _release_cached(self, expr: ir.CachedTable) -> None: + def _release_cached(self, expr: ir.CachedTableExpr) -> None: """Releases the provided cached expression. Parameters diff --git a/ibis/backends/duckdb/__init__.py b/ibis/backends/duckdb/__init__.py index 972bda05a425..6bd93fa818a4 100644 --- a/ibis/backends/duckdb/__init__.py +++ b/ibis/backends/duckdb/__init__.py @@ -1467,7 +1467,7 @@ def _register_in_memory_table(self, op: ops.InMemoryTable) -> None: # 2. broken for string[pyarrow] dtypes (segfault) if conversions := { colname: "str" - for colname, col in table.items() + for colname, col in getattr(table, "obj", table).items() if isinstance(col.dtype, pd.StringDtype) }: table = table.astype(conversions) @@ -1477,7 +1477,7 @@ def _register_in_memory_table(self, op: ops.InMemoryTable) -> None: # register creates a transaction, and we can't nest transactions so # we create a function to encapsulate the whole shebang def _register(name, table): - self.con.register(name, table) + self.con.register(name, getattr(table, "obj", table)) try: _register(name, table)