There is corner case in system when 2 vehicles are selected and during route edits, all jobs are gets assigned to single vehicle. Ultimately, it cause an error when we save edited route.
KeyError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).
File "/home/appuser/venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 564, in _run_script
exec(code, module.__dict__)
File "/app/app_vukwm_bag_delivery/pages/05_Update_Routes.py", line 129, in <module>
update_routes_test_widget.main()
File "/app/app_vukwm_bag_delivery/app_vukwm_bag_delivery/update_routes/update_routes_test_widget.py", line 285, in main
activate_side_bar()
File "/app/app_vukwm_bag_delivery/app_vukwm_bag_delivery/update_routes/controls.py", line 69, in activate_side_bar
process_assigned_data.update_assigned_stops()
File "/app/app_vukwm_bag_delivery/app_vukwm_bag_delivery/update_routes/process_assigned_data.py", line 227, in update_assigned_stops
solution = solution.assign(
File "/home/appuser/venv/lib/python3.10/site-packages/pandas/core/frame.py", line 3811, in __getitem__
indexer = self.columns._get_indexer_strict(key, "columns")[1]
File "/home/appuser/venv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6113, in _get_indexer_strict
self._raise_if_missing(keyarr, indexer, axis_name)
File "/home/appuser/venv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6176, in _raise_if_missing
raise KeyError(f"{not_found} not in index")
About
There is corner case in system when 2 vehicles are selected and during route edits, all jobs are gets assigned to single vehicle. Ultimately, it cause an error when we save edited route.
Here you can see how to reproduce this bug
Message
KeyError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).