I am trying to use st.dataframe to read and display data from a table. One of the columns contains JSON data, stored as JSON in MYSQL.
I am on streamlit 1.45.0, upgrading to 1.46 requires a lot of changes for navigating between pages so avoiding it for now.
column_config = {
"id": st.column_config.TextColumn(
"ID",
width="medium",
help="Unique identifier "
),
"data": st.column_config.JSONColumn(
"Data",
width="large",
help="JSON data"
)
}
st.dataframe(
results_df,
column_config=column_config,
use_container_width=True,
hide_index=True
)
I am using a Docker container to run this, I verified that the streamlit version installed in the container is 1.45
But I am seeing the following error:
AttributeError: module 'streamlit.column_config' has no attribute 'JSONColumn'
Traceback:
File "/app/streamlit_ui/pages/details.py", line 280, in <module>
main()File "/app/streamlit_ui/pages/details.py", line 251, in main
"data": st.column_config.JSONColumn(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
I changed versions to see if it would solve the error, but it doesn’t.
Currently defaulting to TextColumn to get around this.