Skip to content

bug: Ibis ibis.memtable(df).to_polars() doesn't round-trip Polars #11208

Open
@MarcoGorelli

Description

@MarcoGorelli

What happened?

In [1]: import polars as pl

In [2]: import ibis

In [3]: ibis.set_backend('polars')

In [4]: df = pl.DataFrame({'a': [1,1,2], 'b': ['red', 'red', 'green']}, schema_overrides={'b': pl.Enum(['red', 'green',
   ...: 'white'])})

In [5]: df
Out[5]:
shape: (3, 2)
┌─────┬───────┐
│ ab     │
│ ------   │
│ i64enum  │
╞═════╪═══════╡
│ 1red   │
│ 1red   │
│ 2green │
└─────┴───────┘

In [6]: ibis.memtable(df).to_polars()
Out[6]:
shape: (3, 2)
┌─────┬───────┐
│ ab     │
│ ------   │
│ i64str   │
╞═════╪═══════╡
│ 1red   │
│ 1red   │
│ 2green │
└─────┴───────┘

What version of ibis are you using?

10.5.0

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

No response

Relevant log output

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior inside of ibis

    Type

    No type

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions