Very strange bug in st.dataframe!

Summary

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.

Actual behavior:

I’m getting this error:

Debug info

  • Streamlit version: 1.16.0
  • Python version: 3.7.1
  • Using Conda
  • OS version: windows 10
1 Like

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.

1 Like

Thank you for the verification. Please let us know if you run into the issue again.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.