Repository: streamlit/streamlit

Issue:
`CachedStFunctionWarning` incorrectly asks users to set `suppress_st_warning=True` when widget replay is disabled
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

When you include Streamlit widgets in a cache decorated function, a `CachedStFunctionWarning` is raised because widget replay is disabled by default. That `CachedStFunctionWarning` message asks users to set `suppress_st_warning=True` in the caching decorator to suppress the warning. However, the new cache primitives do not support `suppress_st_warning` as a param.

The warning needs to be edited to replace the mention of `suppress_st_warning` with `experimental_allow_widgets`.

### Reproducible Code Example

```Python
import streamlit as st

@st.cache_resource
def foo():
    st.text_input("foo")

foo()

st.button("Re-run")
```


### Steps To Reproduce

1. Run the app
2. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222660804-469fca80-34e0-4796-8bae-7e4191e4c153.png)
3. Follow the suggestion and rewrite to `@st.cache_resource(suppress_st_warning=True)`
4. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222661301-8f918598-632c-49a8-a130-18ba2f05cf93.png)

### Expected Behavior

1. Run the app
2. Expect to see:
![image](https://user-images.githubusercontent.com/20672874/222661556-d57dc2d1-13f0-41aa-850c-0b273cb1a7d0.png)
3. Follow the suggestion and rewrite to `@st.cache_resource(experimental_allow_widgets=True)`
4. Expect to see:
![image](https://user-images.githubusercontent.com/20672874/222661765-7413e405-b485-4be6-8ba3-8f6a4447c33e.png)


### Current Behavior

1. Run the app
2. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222660804-469fca80-34e0-4796-8bae-7e4191e4c153.png)
3. Follow the suggestion and rewrite to `@st.cache_resource(suppress_st_warning=True)`
4. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222661301-8f918598-632c-49a8-a130-18ba2f05cf93.png)

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.19.0
- Python version: 3.9
- Operating System: macOS
- Browser: Chrome
- Virtual environment: None


### Additional Information

_No response_

### Are you willing to submit a PR?

- [X] Yes, I am willing to submit a PR!
`CachedStFunctionWarning` incorrectly asks users to set `suppress_st_warning=True` when widget replay is disabled
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

When you include Streamlit widgets in a cache decorated function, a `CachedStFunctionWarning` is raised because widget replay is disabled by default. That `CachedStFunctionWarning` message asks users to set `suppress_st_warning=True` in the caching decorator to suppress the warning. However, the new cache primitives do not support `suppress_st_warning` as a param.

The warning needs to be edited to replace the mention of `suppress_st_warning` with `experimental_allow_widgets`.

### Reproducible Code Example

```Python
import streamlit as st

@st.cache_resource
def foo():
    st.text_input("foo")

foo()

st.button("Re-run")
```


### Steps To Reproduce

1. Run the app
2. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222660804-469fca80-34e0-4796-8bae-7e4191e4c153.png)
3. Follow the suggestion and rewrite to `@st.cache_resource(suppress_st_warning=True)`
4. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222661301-8f918598-632c-49a8-a130-18ba2f05cf93.png)

### Expected Behavior

1. Run the app
2. Expect to see:
![image](https://user-images.githubusercontent.com/20672874/222661556-d57dc2d1-13f0-41aa-850c-0b273cb1a7d0.png)
3. Follow the suggestion and rewrite to `@st.cache_resource(experimental_allow_widgets=True)`
4. Expect to see:
![image](https://user-images.githubusercontent.com/20672874/222661765-7413e405-b485-4be6-8ba3-8f6a4447c33e.png)


### Current Behavior

1. Run the app
2. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222660804-469fca80-34e0-4796-8bae-7e4191e4c153.png)
3. Follow the suggestion and rewrite to `@st.cache_resource(suppress_st_warning=True)`
4. You see the following:
![image](https://user-images.githubusercontent.com/20672874/222661301-8f918598-632c-49a8-a130-18ba2f05cf93.png)

### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

- Streamlit version: 1.19.0
- Python version: 3.9
- Operating System: macOS
- Browser: Chrome
- Virtual environment: None


### Additional Information

_No response_

### Are you willing to submit a PR?

- [X] Yes, I am willing to submit a PR!


Discussion:

Resolving patch:
diff --git a/lib/streamlit/runtime/caching/cache_errors.py b/lib/streamlit/runtime/caching/cache_errors.py
--- a/lib/streamlit/runtime/caching/cache_errors.py
+++ b/lib/streamlit/runtime/caching/cache_errors.py
@@ -115,8 +115,8 @@ def __init__(
 
 How to fix this:
 * Move the %(st_func_name)s call outside %(func_name)s.
-* Or, if you know what you're doing, use `@st.%(decorator_name)s(suppress_st_warning=True)`
-to suppress the warning.
+* Or, if you know what you're doing, use `@st.%(decorator_name)s(experimental_allow_widgets=True)`
+to enable widget replay and suppress this warning.
             """
             % args
         ).strip("\n")


Test patch: