Version 1.12.0

Highlights

  • :bar_chart: Built-in charts (e.g. st.line_chart) get a brand-new look and parameters x and y! Check out our blog post for more information.

Notable Changes

  • :play_or_pause_button: Functions cached with st.experimental_memo or st.experimental_singleton can now contain static st commands. This allows caching text, charts, dataframes, and more!
  • ā†”ļø The sidebar is now resizable via drag and drop.
  • :phone: st.info, st.success, st.error, and st.warning got a redesign and have a new keyword-only parameter: icon.

Other Changes

  • :level_slider: st.select_slider correctly handles all floats now (#4973, #4978).
  • :1234: st.multi_select can take values from enums (#4987).
  • :tangerine: st.slider range values can now be set through st.session_state (#5007).
  • :art: st.progress got a redesign (#5011, #5086).
  • :radio_button: st.radio better deals with list-like dataframes (#5021).
  • :man_genie: st.cache properly handles JSON files now (#5023).
  • :anchor: Headers render markdown now when the anchor parameter is set (#5038).
  • :mount_fuji: st.image can now load SVGs from Inkscape (#5040).
  • :world_map: st.map and st.pydeck_chart use light or dark style based on the appā€™s theme (#5074, #5108).
  • :balloon: Clicks on elements below st.balloons and st.snow donā€™t get blocked anymore (#5098).
  • :top: Embedded apps have lower top padding (#5111).
  • :nail_care: Adjusted padding and alignment for widgets, charts, and dataframes (#4995, #5061, #5081).
  • :writing_hand: More type hints! (#4926, #4932, #4933)
5 Likes

Hi @jrieke, I upgraded Streamlit from 1.11.0 to 1.12.0.

In my Streamlit application I had a sidebar with a st.radio with many elements. 1.11.0 had a scrollbar, whereas 1.12.0 didnā€™t have a scrollbar, so I couldnā€™t get to the elements beyond the bottom of the page. I reverted to 1.11.0 and everything was fine.

This may be a bug that your team can check out.

Cheers

@Shawn_Pereira Does the scrollbar not show up for you at all? Can you make a small video by any chance? And which browser are you using?

I realized we made a little bug where you cannot actually click the scrollbar (related to the user-resizable sidebar). Filed an issue here. Iā€™ll make sure we fix that. But it should still show up at least (and it does for me!).

Hi @jrieke
Apologies for the late reply (and the long post :slight_smile:).

Regarding the problem described in the earlier post, and to answer your questions:

  1. I am unable to make a video due to data confidentiality reasons
  2. I use Firefox 103.0.2 (32-bit)

Hereā€™s the pix w/1.11.0: As you can see, the scrollbar is available (so I can move well beyond the length of the page).

With regard to 1.12.0:

  1. If the sidebar is reduced too much, the scrollbar appears a distance away to the right (where you donā€™t expect it to be), and therefore think there is no scrollbar.

  1. If the sidebar is increased too much, the opposite happens. Again, you will have to move your mouse horizontally to find the scrollbar (as it does not stick to the edge of the sidebar, as one would expect it to, otherwise the scrollbar doesnā€™t appear)

  1. If the position of the sidebar-width-change drag handles coincide with the internal scrollbar position (where the scrollbar is supposed to appear), no scrollbar is displayed at all until the sidebar width is changed (because they probably overlap). This, I suspect, is what happened when I tried 1.12.0 out.

Further:
Here is an example if the user reduces the sidebar too much in 1.12.0 (the sidebar elements spill over)

In the applications I write (using Streamlit), there is never a reason for the end user of the application to adjust the sidebar. I therefore suggest a new alternative commandā€¦ say st.sidebarwidth(width = ?), which one can use to create different sidebar widths for each page depending on the content of that page.

Cheers

1 Like

I support this idea. So far I have been doing this by injecting some CSS. But having this option as a built-in function alongside a boolean switch to generally turn the resizable sidebar on/off for the entire app (be it through a parameter passed to a streamlit function call or some configuration file) would be the best solution.

2 Likes

Thanks @jrieke ā€¦

Iā€™m getting a strange type error after upgrade to 1.12.0

  File "/opt/anaconda3/lib/python3.9/typing.py", line 1083, in _no_init
    raise TypeError('Protocols cannot be instantiated')

Rollback to 1.11.0 was fine.

Any ideas?

1 Like

@altanner This bug has been confirmed and thereā€™s a plausible workaround in this GitHub issue:

1 Like

Thanks - in future Iā€™ll check the repo for known issues :slight_smile:

1 Like

After update to 1.12, start old project, get an error like this:

File "C:\Python38\Scripts\streamlit.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No moudle named "streamlit.cli"

back to 1.11.1, this error disappear.

from streamlit.scriptrunner import add_script_run_ctx

scriptrunner and add_script_run_ctx not found after updating to latest version.

Could you please let me know if there are any changes made to the names?

@Shawn_Pereira Hmm ok that is indeed a bug. Iā€™m on vacation right now, so canā€™t look into it for the next 2 weeks. Could you open an issue on Github and copy your text/screenshots in there? Then we have it tracked and the engineers can look into it. Fyi @mayabarnes for visibility.

@madhu_thatikonda

Hi @snehankekre,

I upgraded Streamlit from 1.11.0 to 1.12.0 on my office server. When I tried to run Streamlit, I got the following error:

Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python39\Scripts\streamlit.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'streamlit.cli'

As per online help, I even tried ā€˜pip install networkxā€™ but nothing worked. I am in a fix as all the streamlit applications are down due to this.

Can you suggest a way to solve this?

Thanks in advance,

Hi @Shawn_Pereira

Iā€™m afraid I donā€™t have a solution for it just yet. Did you try killing and restarting the apps after the update? Do you also run into the error when using the python -m streamlit run app.py format?

Note: streamlit.cli has moved to streamlit.web.cli

Thanks @snehankekre for the quick response.

Yes, I tried all that you mentioned; rebooted the machine too. Didnā€™t work. Uninstalled Streamlit and found that it could still invoke version 0.87.

Promptly installed version 1.11 thereafter and everything was fine. I think Iā€™ll skip 1.12 and move to the next version whenever it becomes available. 1.12 has me spooked.

Thanks once again for your suggestions and support.

Cheers

same here in local i can run my app :
TypeError: Protocols cannot be instantiated

and on cloud same bug for sidebar resizing

With 1.11 its work

I get this same message.
Downgrades to 1.11.1 and all is OKā€¦

Hopefully this is fixed in the next release.

@Egos @LukeF Thatā€™s a known issue caused by Python 3.9.7. Upgrading your Python version (e.g. to 3.9.12) will fix it. See here: Uncaught exception: TypeError: Protocols cannot be instantiated Ā· Issue #5140 Ā· streamlit/streamlit Ā· GitHub

2 Likes

Ah fascinating. Thank you!

Amazing, thank you :slight_smile: :+1: Confirmed as failing on Python 3.9.7 but working with 3.10.6