Skip to content

Commit

Permalink
chore: handle pseudohashables
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Nov 26, 2023
1 parent de06188 commit a572c99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ibis/backends/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a572c99

Please sign in to comment.