I have an app where on first load I check the time the file was last updated using pathlib.Path.stat().st_mtime and then store that in session_state as last_update_time.
I then on rerun use the same function and compare the output to last_update_time, and if different I refresh the dataframe from the updated file.
I’m sure it’s far from the most efficient way of doing this but it works.
Good idea indeed, thanks for sharing
In my case i’m not sure it helps because if I rerun my app, it will reload the csv file, and as it is a light file, it doesn’t consume a lot of time. I just want it to be reloaded without reloading the whole code when changes are noticed.