I am running into an issue in one of my apps with a date input widget. For this app, the widget allows the user to input a date range which then controls a bar chart in the app.
One thing I have noticed is that when selecting the dates from the calendar the app re-runs upon selection of the first date (before the second date is selected) which causes an index error in my code every time. When the user selects the second date everything runs smoothly, but it is not the best user experience to get a full page error in the middle of selecting their desired date range.
Any tips on how to avoid app execution until a complete selection is made?
Hi randy, thank you for your suggestion but I am facing the same problem and I can’t get your suggested solution to work.
I doubt it is even possible as the expected output from the 'st.date_input(…) statement in this example are 2 variables. Streamlit immediately throws an error when selecting ‘start_date’ because the end_date variable is not defined yet. ie the error is generated even before getting to the if-statement. The same happens when
Perhaps I am mis-understanding you suggested solution, so maybe you could clarify on this?