Repository: streamlit/streamlit

Issue:
st.cache_data docstring for show_spinner is incorrect
### 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

The docstring for `st.cache_data` (which is used in the API Reference docs) lists the only supported type of `show_spinner` argument as boolean. However it also accepts a string. It should be updated to reflect the actual behavior.

https://docs.streamlit.io/library/api-reference/performance/st.cache_data

I believe it works the same as cache_resource, so it could copy that docstring.

### Reproducible Code Example

_No response_

### Steps To Reproduce

_No response_

### Expected Behavior

_No response_

### Current Behavior

_No response_

### Is this a regression?

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

### Debug info

- Streamlit version: 1.19

### Additional Information

_No response_

### Are you willing to submit a PR?

- [X] Yes, I am willing to submit a PR!
st.cache_data docstring for show_spinner is incorrect
### 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

The docstring for `st.cache_data` (which is used in the API Reference docs) lists the only supported type of `show_spinner` argument as boolean. However it also accepts a string. It should be updated to reflect the actual behavior.

https://docs.streamlit.io/library/api-reference/performance/st.cache_data

I believe it works the same as cache_resource, so it could copy that docstring.

### Reproducible Code Example

_No response_

### Steps To Reproduce

_No response_

### Expected Behavior

_No response_

### Current Behavior

_No response_

### Is this a regression?

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

### Debug info

- Streamlit version: 1.19

### Additional Information

_No response_

### Are you willing to submit a PR?

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


Discussion:
@tconkling @snehankekre FYI - let me know if I should submit a quick PR for this (but I might screw it up 😉 )
@tconkling @snehankekre FYI - let me know if I should submit a quick PR for this (but I might screw it up 😉 )

Resolving patch:
diff --git a/lib/streamlit/runtime/caching/cache_data_api.py b/lib/streamlit/runtime/caching/cache_data_api.py
--- a/lib/streamlit/runtime/caching/cache_data_api.py
+++ b/lib/streamlit/runtime/caching/cache_data_api.py
@@ -413,9 +413,10 @@ def _decorator(
             for an unbounded cache. (When a new entry is added to a full cache,
             the oldest cached entry will be removed.) The default is None.
 
-        show_spinner : boolean
+        show_spinner : boolean or string
             Enable the spinner. Default is True to show a spinner when there is
-            a cache miss.
+            a "cache miss" and the cached data is being created. If string,
+            value of show_spinner param will be used for spinner text.
 
         persist : str or boolean or None
             Optional location to persist cached data to. Passing "disk" (or True)
@@ -574,7 +575,6 @@ def __init__(
         self.allow_widgets = allow_widgets
 
     def get_stats(self) -> list[CacheStat]:
-
         if isinstance(self.storage, CacheStatsProvider):
             return self.storage.get_stats()
         return []


Test patch: