You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to generate Pandas Series in cached functions.
Steps to reproduce
Run this code:
import streamlit as st
import pandas as pd
@st.cache
def test_function():
series = pd.Series()
return series
test_function()
Expected behavior:
Expect to be able to create Pandas Series inside of cached functions.
Actual behavior:
Following error is thrown:
TypeError: stat: path should be string, bytes, os.PathLike or integer, not property
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/ScriptRunner.py", line 317, in _run_script exec(code, module.__dict__)
File "/home/jforth/Documents/streamlit_test.py", line 9, in <module> test_function()
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/caching.py", line 393, in wrapped_func code_hasher.update(func)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 159, in update self._update(self.hasher, obj, context)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 190, in _update b = self.to_bytes(obj, context)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 179, in to_bytes b = self._to_bytes(obj, context)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 259, in _to_bytes h.update(self._code_to_bytes(obj.__code__, context))
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 316, in _code_to_bytes self._update(h, ref, context)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 190, in _update b = self.to_bytes(obj, context)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 179, in to_bytes b = self._to_bytes(obj, context)
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/site-packages/streamlit/hashing.py", line 236, in _to_bytes isinstance(obj, io.IOBase) or os.path.exists(obj.name)):
File "/home/jforth/anaconda3/envs/AutoDraft/lib/python3.7/genericpath.py", line 19, in exists os.stat(path)
Is this a regression?
Not sure.
Debug info
Streamlit version: 0.45.0
Python version: 3.7.4
Using Conda
OS version: Ubuntu 19.04
Browser version: Chrome 77.0.3865.75
The text was updated successfully, but these errors were encountered:
Summary
Unable to generate Pandas Series in cached functions.
Steps to reproduce
Run this code:
Expected behavior:
Expect to be able to create Pandas Series inside of cached functions.
Actual behavior:
Following error is thrown:
Is this a regression?
Not sure.
Debug info
The text was updated successfully, but these errors were encountered: