Skip to content

Conversation

@snehankekre
Copy link
Contributor

📚 Context

All three caching primitives now allow st.write() to be included/replayed in the cached function. Currently when a CachedStFunctionWarning is raised, the message includes a mention of st.write(). Note: no warning is raised when st.write() is used in a cache-decorated function:

import streamlit as st

@st.cache
def foo():
    st.write("bar")

foo() # CachedStFunctionWarning is not raised
  • What kind of change does this PR introduce?

    • Bugfix

🧠 Description of Changes

Removes the mention of st.write() from CachedStFunctionWarning

  • This is a visible (user-facing) change

Revised:

import streamlit as st

@st.experimental_memo
def foo():
    st.image("https://www.streamlit.io/images/brand/streamlit-mark-color.png")

foo() # Warning doesn't include st.write()
Toggle to view screenshot

image

Current:

import streamlit as st

@st.experimental_memo
def foo():
    st.image("https://www.streamlit.io/images/brand/streamlit-mark-color.png")

foo() # Incorrectly includes st.write() in the warning
Toggle to view screenshot

image

🧪 Testing Done

  • Screenshots included

@snehankekre snehankekre requested a review from AnOctopus November 9, 2022 11:33
@vdonato vdonato merged commit e373013 into streamlit:develop Nov 11, 2022
tconkling added a commit to tconkling/streamlit that referenced this pull request Nov 18, 2022
* develop: (25 commits)
  Fix CORS acronym in docstring (streamlit#5727)
  Add integration tests for Snowpark (streamlit#5543)
  Release/1.15.0 (streamlit#5720)
  Add audit_frontend_dependencies script to CODEOWNERS (streamlit#5708)
  Add label_visibility option for st.checkbox (streamlit#5705)
  Display existing column names in st.map exception and make st.map work with capital letters (streamlit#5679)
  Plotly Customization (streamlit#5681)
  Turn off theme for now (streamlit#5701)
  Add all vendored code to `make notices` (streamlit#5704)
  Audit frontend licenses (streamlit#5664)
  Surround labels in quotes (streamlit#5703)
  Add info about voting on features (streamlit#5660)
  Update issue labeling scheme to adopt new standards (streamlit#5702)
  Cached media (audio+video) replay (streamlit#5695)
  Fix docstring line wrap (streamlit#5698)
  Use specialized assertion functions (streamlit#5680)
  Release 1.14.1 (streamlit#5693)
  Image replay in cached functions (streamlit#5675)
  Add docstrings for `experimental_allow_widgets` (streamlit#5670)
  Remove `st.write` from `CachedStFunctionWarning` (streamlit#5669)
  ...
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