Aggrid crashing my app (may be a caching issue)

Hey all-

I’m pretty new to streamlit, but running into some unexpected issues while testing. An issue very similar to mine was also described here Streamlit-aggrid crashing my streamlit application - #14 by bkandel - and seems a feature may have been at issue and fixed in a previous push?

I was attempting to beautify + functionalize my dataframe via aggrid, but as soon as I had it imported I started to get page non-responsive issues in running my app locally (Chrome browser).

Specs simplified here:

import streamlit as st
from st_aggrid import GridOptionsBuilder, AgGrid, GridUpdateMode, DataReturnMode
import pandas as pd
from pandas.io.json import json_normalize
import json
import numpy as np

st.set_page_config(
    page_title="Dashboard",
    page_icon="📊",
    layout="wide"
)

st.title("demo of dashboard")

data = pd.read_csv('data/mydata.csv', index_col=0)

@st.cache
def load_data():
    return data

#data = load_data()

st.write('Anomalous Events for Review')
df = pd.DataFrame(data)
st.write(df[:1000])
#df = get_data()
AgGrid(df)

I had a file stored in github, cloned locally, that was already on the outside of git’s permissibility at ~150k records and 22GB. So I shrunk it for the sake of testing and tried with one ~a third of the size (but same data-types; nothing too fancy but string-heavy.)

This led to the same page nonresponsive issue.

Got rid of aggrid - and everything was fine. Less beautiful, but fine.

What am I doing wrong here with caching? I read (aka chatbotgpt told me) maybe I can increase the number of concurrent connections permitted in my page_config? But couldn’t get that working - AI’s not that smart yet…

Any help would be appreciated - or happy to open a bug.

Have you tried:


@st.cache
def load_data():
    return pd.read_csv('data/mydata.csv', index_col=0, nrows=10000)

data = load_data()
AgGrid(data)