Summary
Iam using dataframe_explorer from streamlit_extras Module for filtering a dataframe which contains a datetime object that is formatted (“%d/%m/%Y %H:%M:%S”) but when i run the code the time columns is formatted to (“%Y/%m/%d %H:%M:%S”)
and the filter options are also working properly , i even tried to converting into a pandas datetime object, df1[“Time”]=pd.to_datetime(filtered_df1[“Time”], format=“%d/%m/%Y %H:%M:%S”) and when i give input in the filter column the last row is not visible unless in reload the code
Steps to reproduce
@st.cache_data()
def update_data(_df1,_time_formatted,_count,_component_names,column_names):
_df1.loc[len(_df1)] = [_time_formatted, _count, _component_names]
def filter(column_names):
with st.sidebar:
st.subheader(“Filter Service Down Time History”)
filtered_df1 = dataframe_explorer(df1)
return filtered_df1
if name =“main”:
time1 = datetime.datetime.now()
time_formatted = time1.strftime(“%d/%m/%Y %H:%M:%S”)
update_data(df1,time_formatted, len(inactive_components), component_names, column_names)
df1[“Time”] = pd.to_datetime(df1[“Time”], format=“%d/%m/%Y %H:%M:%S”)
filtered_df, filtered_df1 = filter(column_names)
Expected behavior:
i want to be able to filter the data with the Time column and there shouldnt be any rows missing
Actual behavior:
when i run the code the time columns is formatted to (“%Y/%m/%d %H:%M:%S”)
and the filter options are also working properly and when i give input in the filter column the last row is not visible unless in reload the code
Debug info
- Streamlit version: Streamlit, version 1.22.0
- Python version: Python 3.11.2
- Using PyEnv - Pycharm
- OS version:
- Browser version: