Skip to content

Comments

fix: replace deprecated use_container_width with width='stretch#157

Open
saurabh12nxf wants to merge 1 commit intom-lab:mainfrom
saurabh12nxf:fix/streamlit-deprecation-use-container-width
Open

fix: replace deprecated use_container_width with width='stretch#157
saurabh12nxf wants to merge 1 commit intom-lab:mainfrom
saurabh12nxf:fix/streamlit-deprecation-use-container-width

Conversation

@saurabh12nxf
Copy link

Summary

Removes all uses of the deprecated use_container_width parameter
across the prototype, replacing with the new width="stretch" API.

Motivation

Streamlit deprecated use_container_width for removal after 2025-12-31.
The Streamlit server was logging deprecation warnings on every page load:

Please replace `use_container_width` with `width`.
`use_container_width` will be removed after 2025-12-31.
For `use_container_width=True`, use `width='stretch'`.

Changes

  • prototype/Home.py: 1 st.plotly_chart call
  • prototype/visualizations/ui_components.py: 4 st.button + 1 st.plotly_chart calls

References

  • Streamlit changelog
  • Consistent with the pattern already used in prototype/pages/IQB_Map.py
    (which uses width="stretch" and width="stretch" for dataframes)

@bassosimone
Copy link
Collaborator

A-ha, good catch! I will take a more in depth look, but this feels like a surgical improvement. Thanks!

@bassosimone
Copy link
Collaborator

After listing our project for GSoC, we received a large amount of pull requests across several repositories. We are dealing with the backlog, but this would take time. We will get back to this pull request eventually. In the meanwhile, if you are a GSoC applicant, please read our updated GSoC policy: https://github.com/m-lab/gsoc/.

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