I have faced issues when I’m running some charts in Streamlit using Pandas 1.3 or greater, and to fix it I needed to downgraded the Pandas to any version below 1.3.
The most common error is: TypeError: _translate() missing 2 required positional arguments: ‘sparse_index’ and ‘sparse_cols’
Any update about whether it is planned to be fixed in the future?
Yes, we have an internal tool in Streamlit, that it does not work properly on Streamlit when the Pandas version is greater than 1.3. The charts don’t appear on the Streamlit interface, what happens instead is an error message - see below.
TypeError: _translate() missing 2 required positional arguments: 'sparse_index' and 'sparse_cols'
File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\script_runner.py", line 332, in _run_script
exec(code, module.__dict__)File "C:\ProgramData\Anaconda3\Lib\site-packages\pyrpa\UI\capping_ui_v2.py", line 340, in <module>
st.table(data=dec_df)File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\elements\data_frame_proto.py", line 119, in table
marshall_data_frame(data, table_proto)File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\elements\data_frame_proto.py", line 149, in marshall_data_frame
_marshall_styles(proto_df.style, df, styler)File "C:\Users\cvalenzuela\AppData\Roaming\Python\Python39\site-packages\streamlit\elements\data_frame_proto.py", line 168, in _marshall_styles
translated_style = styler._translate()