Skip to content

Commit

Permalink
chore: handle the snowflake case of needed a select on VALUES
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Mar 15, 2023
1 parent 73cfaef commit b6f5df7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ibis/backends/base/sql/alchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,12 @@ def _get_insert_method(self, expr):
and isinstance(expr.op(), ops.InMemoryTable)
):
(from_,) = compiled.get_final_froms()
(rows,) = from_._data
return methodcaller("values", rows)
try:
(rows,) = from_._data
except AttributeError:
return methodcaller("from_select", list(expr.columns), from_)
else:
return methodcaller("values", rows)

return methodcaller("from_select", list(expr.columns), compiled)

Expand Down

0 comments on commit b6f5df7

Please sign in to comment.