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: