For a giver number of columns, I’m not able to display more than a fixed number of rows, and it raises this error AttributeError: ‘Future’ object has no attribute ‘type’.
Steps to reproduce
Code snippet:
st.dataframe(df_test.iloc[:200, :2]) # OK
st.dataframe(df_test.iloc[:201, :2]) # KO
st.dataframe(df_test.iloc[:400, :4]) # OK
st.dataframe(df_test.iloc[:401, :4]) # KO
st.dataframe(df_test.iloc[:800, :8]) # OK
st.dataframe(df_test.iloc[:801, :8]) # KO
Expected behavior:
The dataframe should be shown correctly regardless of the #cols#rows.
I replicated the issue and seems to work on my end unless you have some async code.
Here’s the replication code:
import streamlit as st
import pandas as pd
import numpy as np
st.set_page_config(layout="wide")
# DF with 1000 rows and 10 columns
num_rows = 1000
num_cols = 10
data = np.random.rand(num_rows, num_cols)
df_test = pd.DataFrame(data)
st.dataframe(df_test.iloc[:200, :2]) # OK
st.dataframe(df_test.iloc[:201, :2]) # OK
st.dataframe(df_test.iloc[:400, :4]) # OK
st.dataframe(df_test.iloc[:401, :4]) # OK
st.dataframe(df_test.iloc[:800, :8]) # OK
st.dataframe(df_test.iloc[:801, :8]) # OK
You can share more of your code if you’re still experiencing errors.
I’m sure I was not having any async code, as a matter of fact, I was able to download as csv the same dataframe I was not able to visualize with st.dataframe.
However this is surely some edge case bug, as I’m not able to reproduce the issue myself.
The app was streaming daily production data so I can’t replicate the exact same data values that caused the bug.
I guess this’ll stay ambiguous until someone else was able to get more on this issue.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.