Open shrianshChari opened 6 months ago
Thank you for reporting this!
df.to_parquet()
here is done without any error.
https://github.com/whitphx/streamlit/blob/stlite-1.35.0/lib/streamlit/type_util.py#L1131
Maybe the problem is from fastparquet
and/or parquet-wasm
?
-> Looks like fastparquet
sets the column metadata "pandas_type": "mixed"
in this case where pyarrow
does "pandas_type": "list[unicode]"
.
The code is here?
https://github.com/dask/fastparquet/blob/1891a4a55fbe2ac23b29c064258c9c2eba480d28/fastparquet/util.py#L407-L408
Sample code:
import streamlit as st
import pandas as pd
df = pd.DataFrame({
"names": [["foo", "bar"], ["baz", "quz"]]
})
st.dataframe(df)
When I attempt to render a dataframe that contains a column that is a list of strings (in this case my dataset is called
spl
and the column is titledteam
), the strings will be displayed correctly in Streamlit (run locally on my machine) but not when it gets translated using stlite (run using stlite sharing):Output in Streamlit:
Output in stlite:
When I take the first row of the output from stlite and convert each number into its corresponding ASCII character value,
It seems that it is able to recognize that
spl['team']
is a column that contains a list of strings, as when I run:I get the same output for both Streamlit and stlite: