Close, but getting 2 different warning messages and one traceback:
1st)
More information: to prevent unexpected behavior, Streamlit tries to detect mutations in cached objects so it can alert the user if needed. However, something went wrong while performing this check.
Please file a bug.
To stop this warning from showing in the meantime, try one of the following:
- Preferred: modify your code to avoid using this type of object.
- Or add the argument
ignore_cache=Trueto thest.cachedecorator.
2nd)
Streamlit failed to hash an object of type <class ‘function’>.,
More information: to prevent unexpected behavior, Streamlit tries to detect mutations in cached objects so it can alert the user if needed. However, something went wrong while performing this check.
Please file a bug.
To stop this warning from showing in the meantime, try one of the following:
- Preferred: modify your code to avoid using this type of object.
- Or add the argument
ignore_cache=Trueto thest.cachedecorator.
Then the actual traceback:
TypeError: object supporting the buffer API required
File “c:\users\user\appdata\local\continuum\anaconda3_64bit\envs\dashboards\lib\site-packages\streamlit\ScriptRunner.py”, line 306, in _run_script exec(code, module.dict)
File “D:\pyscripts\streamlit\defect_rates.py”, line 21, in conn = get_db_conn()
File “c:\users\user\appdata\local\continuum\anaconda3_64bit\envs\dashboards\lib\site-packages\streamlit\caching.py”, line 544, in wrapped_func return get_or_set_cache()
File “c:\users\user\appdata\local\continuum\anaconda3_64bit\envs\dashboards\lib\site-packages\streamlit\caching.py”, line 509, in get_or_set_cache code_hasher.update(func)
File “c:\users\user\appdata\local\continuum\anaconda3_64bit\envs\dashboards\lib\site-packages\streamlit\hashing.py”, line 185, in update self._update(self.hasher, obj, context)
File “c:\users\user\appdata\local\continuum\anaconda3_64bit\envs\dashboards\lib\site-packages\streamlit\hashing.py”, line 217, in _update hasher.update(b)
On a related note, the warning message suggests to add “ignore_cache=True”, but the suggestion by @Adrien_Treuille says to add “ignore_hash=True” I did ignore_cache=True but got error message saying that doesnt exist. So the warning message needs to change - just FYI.