Hi there, absolute great tool. Congratulations, i was looking for this since a long time.
That’s my situation:
-
I run a streamlit multipage app with two pages/apps in /pages
-
both use dynamic filters, but have different data sources and different associated filter sets
-
Both apps on their own run flawlessly
-
When I switch to the other app I get an error:
KeyError: ‘Produkt’ (the first filter from the app I clicked on first)File “/home/src/pages/1_Chemstation.py”, line 41, in
dynamic_filters.display_filters()File "/opt/conda/lib/python3.10/site-packages/streamlit_dynamic_filters/dynamic_filters.py", line 160, in display_filters options = filtered_df[filter_name].unique().tolist()File "/opt/conda/lib/python3.10/site-packages/pandas/core/frame.py", line 4107, in __getitem__ indexer = self.columns.get_loc(key)File "/opt/conda/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3819, in get_loc raise KeyError(key) from err
So my guess is that:
- When the first app is loaded it stores the filters in the cache.
- When the second app is loaded it retrieves the cached filters, but they are not present in the second app hence the key error.
Is there a way to isolate these two apps from each other so that both can run individually within the multipage setup?
Thank you all in advance.