Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data completely reloads with sorting/filtering interaction with version >=0.3.0 #166

Closed
gregd33 opened this issue Dec 5, 2022 · 4 comments

Comments

@gregd33
Copy link

gregd33 commented Dec 5, 2022

With streamlit-aggrid==0.3.0 or higher and almost any recent version of streamlit, inluding streamlit==0.15.1 , if you have an app that uses a submit button, then the table will disappear when you e.g. try to sort it.

This does not occur with streamlit-aggrid=0.2.3.

Here is a minimal example:

import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
import numpy as np

submit = st.button('Submit', key="submit")

if submit:
    data = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
else:
    data = None

if data is not None:
    AgGrid(data)

More testing shows even just a simple app will result in completely reloading all the data with interactions.

from st_aggrid import AgGrid
import pandas as pd

data = pd.DataFrame([[1,2,3,4],[2,3,4,5]], columns=list('ABCD'))

x = AgGrid(data)
@nafets33
Copy link

nafets33 commented Dec 5, 2022

confirmed experiencing the same issue

I wonder if my issue is related at all? #165

@gregd33
Copy link
Author

gregd33 commented Dec 6, 2022

Just a follow up - even with this minimal app

from st_aggrid import AgGrid
import pandas as pd

data = pd.DataFrame([[1,2,3,4],[2,3,4,5]], columns=list('ABCD'))

x = AgGrid(data)

It works. But you can tell from what's printed on the console and the delay that it is rerunning the entire script on many interactions including sort, filter. So if you put a time.sleep it will sleep with every interaction. This is not the case with 2.3.0.

@gregd33 gregd33 changed the title Sorting/interactivity breaks with a submit button in >=0.3.0 Data completely reloads with sorting/filtering interaction with version >=0.3.0 Dec 6, 2022
@egrelier
Copy link

I noticed the same behavior in v0.3.3. In v0.2.3, it works as expected (no data reloading when interacting with the table).

@gregd33
Copy link
Author

gregd33 commented Dec 13, 2022

See bug report here with proposed solution: #167

@gregd33 gregd33 closed this as completed Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants