Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade streamlit to >=1.30 #7

Closed
wants to merge 2 commits into from
Closed

Conversation

Nikita240
Copy link
Contributor

experimental_get_query_params() and experimental_set_query_params() is deprecated in favor of a new query_params API .

https://docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params#stquery_paramsget_all

@@ -214,7 +214,7 @@ def main():
streamlit.write("## Debugging")

streamlit.write("#### Query String")
query_string: typing.Dict[str, str] = streamlit.experimental_get_query_params()
query_string: typing.Dict[str, str] = streamlit.query_params.get_all()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following error with this:

File "/home/zen/.cache/pypoetry/virtualenvs/streamlit-parameters-Wj2vk3Ob-py3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
File "/home/zen/.cache/pypoetry/virtualenvs/streamlit-parameters-Wj2vk3Ob-py3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
File "/workspaces/streamlit_parameters/streamlit_parameters/demos/parameters.py", line 236, in <module>
    main()
File "/workspaces/streamlit_parameters/streamlit_parameters/demos/parameters.py", line 217, in main
    query_string: typing.Dict[str, str] = streamlit.query_params.get_all()
File "/home/zen/.cache/pypoetry/virtualenvs/streamlit-parameters-Wj2vk3Ob-py3.10/lib/python3.10/site-packages/streamlit/runtime/metrics_util.py", line 410, in wrapped_func
    result = non_optional_func(*args, **kwargs)

However, streamlit.write(streamlit.query_params) works fine.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the api changed (only works for get_all on a single key now).

This misses repeated keys, but that's fine since we're only using it for debugging.

@stonier
Copy link
Owner

stonier commented Nov 26, 2024

Patched and merged in #10.

@stonier stonier closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants