ibis icon indicating copy to clipboard operation
ibis copied to clipboard

bug: parser error when creating dataframe with column 'group'

Open MarcoGorelli opened this issue 6 months ago • 2 comments

What happened?

In [3]: import ibis

In [4]: import polars as pl

In [5]: ibis.duckdb.connect().create_table('a', pl.DataFrame({'foo': [1]}))
Out[5]: 
DatabaseTable: memory.main.a
  foo int64

In [6]: ibis.duckdb.connect().create_table('a', pl.DataFrame({'group': [1]}))
---------------------------------------------------------------------------
ParserException                           Traceback (most recent call last)
Cell In[6], line 1
----> 1 ibis.duckdb.connect().create_table('a', pl.DataFrame({'group': [1]}))

File ~/polars-api-compat-dev/.venv/lib/python3.12/site-packages/ibis/backends/duckdb/__init__.py:223, in Backend.create_table(self, name, obj, schema, database, temp, overwrite)
    219 if query is not None:
    220     insert_stmt = sge.insert(
    221         query, into=initial_table, columns=table.columns
    222     ).sql(dialect)
--> 223     cur.execute(insert_stmt).fetchall()
    225 if overwrite:
    226     cur.execute(
    227         sge.Drop(kind="TABLE", this=final_table, exists=True).sql(dialect)
    228     )

ParserException: Parser Error: syntax error at or near "group"

What version of ibis are you using?

10.8.0

What backend(s) are you using, if any?

duckdb

Relevant log output


Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

MarcoGorelli avatar Sep 01 '25 07:09 MarcoGorelli

@MarcoGorelli this has been fixed in main by https://github.com/ibis-project/ibis/pull/11532. It just isn't released yet. Perhaps we should cut a 10.8.1 bugfix release @cpcloud ?

NickCrews avatar Sep 11 '25 18:09 NickCrews

@NickCrews I'm just following this up to say that #11532 has fixed the issue for us 🥳

  • https://github.com/narwhals-dev/narwhals/pull/3189#issuecomment-3394351773

dangotbanned avatar Oct 12 '25 14:10 dangotbanned