Open 444B opened 4 months ago
@upasana-mittal is this still relevant?
I'm also getting this issue with st.radio
: KeyError: 'LTM'
File ".../streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.__dict__)
line 33, in <module>
selector_screen = st.sidebar.radio(
File ".../streamlit_analytics2/main.py", line 180, in new_func
counts["widgets"][label][selected] += 1
Selector code:
selector_screen = st.sidebar.radio(
'Screen:',
get_all_screens(st.session_state['screen_sorting']),
key='screen_selector'
)
If I use a hardcoded list for options ['a', 'b']
, I don't get this issue.
@cakechaser thanks for validating the bug! I'll take a look into this and see if I can fix it
@444B thanks for the quick reply! I actually just fixed it on my side.
The get_all_screens
function for the radio options was returning a pandas dataframe.
I changed it to return a single column from the dataframe, and now the issue has disappeared.
Basically changing return df
to return df['Column Name']
However streamlit itself is rendering the selector without issues regardless of this change.
Original issue by upasana-mittal on 2023-02-02 22:13:34+00:00
I am getting a key error at st.select slider
start_rating, end_rating = st.select_slider("Select range of CSAT", options=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], value=(2, 4))
KeyError: (2, 4)