How to replace the old experimental_set_query_params function?

Hi,

I have noticed that you have replaced st.experimental_set_query_params - Streamlit Docs with st.query_params - Streamlit Docs

However, it is not clear to me how to change this piece of code I have:
st.experimental_set_query_params(**qparms)
With the new st.query_params() function.

st.query_params(**qparms) is producing the following Exception:
TypeError: 'QueryParamsProxy' object is not callable

Thank you

It is not a function. From the docs:

st.query_params provides a dictionary-like interface to access query parameters in your app’s URL […]. st.query_params can be used with both key and attribute notation. For example, st.query_params.my_key and st.query_params["my_key"]

So st.query_params.key = value or st.query_params["key"] = value should do.

Thank you.
I suggest you to update the docs in order to make explicit how to migrate from the old function to the new.

1 Like

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