Skip to content

Commit 18e7f95

Browse files
committed
fix(compilers): make sure memtable rows have names in the SQL string compilers
1 parent abfaf1f commit 18e7f95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ibis/backends/base/sql/compiler/query_builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ def _format_table(self, expr):
117117
result = self._quote_identifier(name)
118118
is_subquery = False
119119
elif isinstance(ref_op, ops.InMemoryTable):
120+
names = ref_op.schema.names
120121
rows = ", ".join(
121-
f"({', '.join(map(repr, col))})"
122+
f"({', '.join(map('{} AS {}'.format, col, names))})"
122123
for col in ref_op.data.itertuples(index=False)
123124
)
124125
result = f"(VALUES {rows})"

0 commit comments

Comments
 (0)