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

Example stacked bar chart doesn't work with Polars #286

Closed
jonmmease opened this issue Mar 29, 2023 · 3 comments · Fixed by #288
Closed

Example stacked bar chart doesn't work with Polars #286

jonmmease opened this issue Mar 29, 2023 · 3 comments · Fixed by #288
Labels
bug Something isn't working

Comments

@jonmmease
Copy link
Collaborator

Moving vega/altair#3003 from Altair repo, reported by @braaannigan


If we try the example stacked bar chart but convert to Polars it doesn't work (I found this with a similar error on my own data):

import altair as alt
from vega_datasets import data
import polars as pl
import vegafusion as vf

vf.enable()

source = pl.from_pandas(data.seattle_weather())

alt.Chart(source).mark_bar(
    cornerRadiusTopLeft=3,
    cornerRadiusTopRight=3
).encode(
    x='month(date):O',
    y='count():Q',
    color='weather:N'
)

with error message:

thread 'tokio-runtime-worker' panicked at 'assertion failed: `(left == right)`
  left: `LargeUtf8`,
 right: `Utf8`: StringArray expects DataType::Utf8', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow-array-32.0.0/src/array/byte_array.rs:268:9
thread 'tokio-runtime-worker' panicked at 'assertion failed: `(left == right)`
  left: `LargeUtf8`,
 right: `Utf8`: StringArray expects DataType::Utf8', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow-array-32.0.0/src/array/byte_array.rs:268:9
thread 'tokio-runtime-worker' panicked at 'assertion failed: `(left == right)`
  left: `LargeUtf8`,
 right: `Utf8`: StringArray expects DataType::Utf8thread '', tokio-runtime-worker/root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow-array-32.0.0/src/array/byte_array.rs' panicked at ':assertion failed: `(left == right)`
  left: `LargeUtf8`,
 right: `Utf8`: StringArray expects DataType::Utf8268', :/root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow-array-32.0.0/src/array/byte_array.rs9:
268:9
thread 'tokio-runtime-worker' panicked at 'assertion failed: `(left == right)`
  left: `LargeUtf8`,
 right: `Utf8`: StringArray expects DataType::Utf8', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow-array-32.0.0/src/array/byte_array.rs:268:9
thread 'tokio-runtime-worker' panicked at 'assertion failed: `(left == right)`
  left: `LargeUtf8`,
 right: `Utf8`: StringArray expects DataType::Utf8', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/arrow-array-32.0.0/src/array/byte_array.rs:268:9
@jonmmease
Copy link
Collaborator Author

Thanks for the report, I think this may be a manifestation of apache/arrow-rs#2654. I'll look into whether updating Arrow helps (but it may not as this bug is still open), and if not then we can cast LargeUtf8 to Utf8 when needed.

@jonmmease
Copy link
Collaborator Author

This fix will be released in 1.1.2 shortly

@jonmmease
Copy link
Collaborator Author

Fix released in 1.1.2. cc @braaannigan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant