Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting ibis.table converts to pyarrow twice #3471

Closed
MarcoGorelli opened this issue Jul 11, 2024 · 1 comment · Fixed by #3452
Closed

Plotting ibis.table converts to pyarrow twice #3471

MarcoGorelli opened this issue Jul 11, 2024 · 1 comment · Fixed by #3452
Labels

Comments

@MarcoGorelli
Copy link
Contributor

What happened?

import polars as pl
import altair as alt

import ibis
ibis.set_backend('polars')

df = pl.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
tbl = ibis.memtable(df)

alt.Chart(tbl).mark_point().encode(x='a', y='b').to_json()

If I put a breakpoint in arrow_table_from_dfi_dataframe, then I see the conversion from ibis table to arrow table happening twice

What would you like to happen instead?

I think it should be possible to convert at most once?

Which version of Altair are you using?

5.4.0dev (latest commit on main)

@MarcoGorelli
Copy link
Contributor Author

Ah my mistake here, it's only doing one conversion - the second time it hits that breakpoint, dfi_df is a PyArrow table, and so the from_dataframe call is practically a no-op:

https://github.com/apache/arrow/blob/718415030f8ebcad14bc3fa10906beca6526c5e9/python/pyarrow/interchange/from_dataframe.py#L63-L106

Closing then, sorry for the noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant