`st.selectbox` selected option type has change since v1.30?

in the process of updating from v1.30 to v1.37. the latest issues is a breaking change in st.selectbox that I cannot find a reference to in docs, GH issues, or here.

selectbox used to be able to take a sequence/list of complex objects, tuples etc. and the selected option was returned as an instance of that type.

Now it seems like at least of a list of tuples its returning the just the key.

can somebody point me to details about the change and why?

Hey @janaka,

Would you mind giving a reproducible code example for this? I’m not sure I follow what you mean.

Thanks,

I’ll try when I get some time, don’t have the code open at the moment.

In the meantime a little more colour…

After posting I figured it was related to a dict specifically. my old code was setting options with a dict.items(). The selected value was a dict item. once updated to v1.37 select value was the key of the dict item.

I think I’m able to reproduce your issue. It doesn’t seem to me that the issue exists already in GitHub - streamlit/streamlit: Streamlit — A faster way to build and share data apps. - you might want to check and create one if not!

vs.

1 Like

haha 1.37.1 wasn’t released on the weekend (I could see the tag though) :smile:

it wasn’t a hard block once i’d figured it and was only one of the selectbox usage, fortunately. hopefully saves others a bunch of time.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.