From e8ccb19af369575d7b0849b448ef684307550eba Mon Sep 17 00:00:00 2001 From: Atalya Alon Date: Wed, 5 Jun 2024 16:25:29 +0300 Subject: [PATCH] Modify involve_yishuv_name to accident_yishuv_name in widgets filters --- .../killed_and_injured_count_per_age_group_widget_utils.py | 4 ++-- .../severe_fatal_count_by_vehicle_by_year_widget.py | 6 +++--- .../small_motor_severe_fatal_count_by_year_widget.py | 2 +- anyway/widgets/urban_widgets/urban_crosswalk_widget.py | 4 ++-- anyway/widgets/widget_utils.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py b/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py index d3332e64..f0b9d880 100644 --- a/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py +++ b/anyway/widgets/all_locations_widgets/killed_and_injured_count_per_age_group_widget_utils.py @@ -38,9 +38,9 @@ def filter_and_group_injured_count_per_age_group( cache_key = None # prevent pylint warning if request_params.resolution == BE_CONST.ResolutionCategories.STREET: - involve_yishuv_name = request_params.location_info["yishuv_name"] + accident_yishuv_name = request_params.location_info["yishuv_name"] street1_hebrew = request_params.location_info["street1_hebrew"] - cache_key = (involve_yishuv_name, street1_hebrew, start_time, end_time) + cache_key = (accident_yishuv_name, street1_hebrew, start_time, end_time) elif request_params.resolution == BE_CONST.ResolutionCategories.SUBURBAN_ROAD: road_number = request_params.location_info["road1"] diff --git a/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py b/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py index b60f064c..2766aeac 100644 --- a/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py +++ b/anyway/widgets/urban_widgets/severe_fatal_count_by_vehicle_by_year_widget.py @@ -39,7 +39,7 @@ def separate_data(yishuv, start_time, end_time, resolution) -> Dict[str, Any]: InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleType.ELECTRIC_BIKE.value, - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, }, group_by="accident_year", count="accident_year", @@ -55,7 +55,7 @@ def separate_data(yishuv, start_time, end_time, resolution) -> Dict[str, Any]: InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleType.BIKE.value, - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, }, group_by="accident_year", count="accident_year", @@ -71,7 +71,7 @@ def separate_data(yishuv, start_time, end_time, resolution) -> Dict[str, Any]: InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleType.ELECTRIC_SCOOTER.value, - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, }, group_by="accident_year", count="accident_year", diff --git a/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py b/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py index 38a6ac86..a4b951af 100644 --- a/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py +++ b/anyway/widgets/urban_widgets/small_motor_severe_fatal_count_by_year_widget.py @@ -37,7 +37,7 @@ def get_motor_stats(location_info, start_time, end_time, resolution): InjurySeverity.SEVERE_INJURED.value, ], "involve_vehicle_type": VehicleCategory.BICYCLE_AND_SMALL_MOTOR.get_codes(), - "involve_yishuv_name": location_info, + "accident_yishuv_name": location_info, }, group_by="accident_year", count="accident_year", diff --git a/anyway/widgets/urban_widgets/urban_crosswalk_widget.py b/anyway/widgets/urban_widgets/urban_crosswalk_widget.py index c83e0874..69ddd532 100644 --- a/anyway/widgets/urban_widgets/urban_crosswalk_widget.py +++ b/anyway/widgets/urban_widgets/urban_crosswalk_widget.py @@ -39,7 +39,7 @@ def get_crosswalk(yishuv, street, start_time, end_time, resolution) -> Dict[str, InjurySeverity.SEVERE_INJURED.value, ], "cross_location": CrossCategory.CROSSWALK.get_codes(), - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, "street1_hebrew": street, }, group_by="street1_hebrew", @@ -56,7 +56,7 @@ def get_crosswalk(yishuv, street, start_time, end_time, resolution) -> Dict[str, InjurySeverity.SEVERE_INJURED.value, ], "cross_location": CrossCategory.NONE.get_codes(), - "involve_yishuv_name": yishuv, + "accident_yishuv_name": yishuv, "street1_hebrew": street, }, group_by="street1_hebrew", diff --git a/anyway/widgets/widget_utils.py b/anyway/widgets/widget_utils.py index 0d5046eb..75a13368 100644 --- a/anyway/widgets/widget_utils.py +++ b/anyway/widgets/widget_utils.py @@ -201,7 +201,7 @@ def get_involved_marker_view_location_filters( ): filters = {} if resolution == BE_CONST.ResolutionCategories.STREET: - filters["involve_yishuv_name"] = location_info.get("yishuv_name") + filters["accident_yishuv_name"] = location_info.get("yishuv_name") filters["street1_hebrew"] = location_info.get("street1_hebrew") elif resolution == BE_CONST.ResolutionCategories.SUBURBAN_ROAD: filters["road1"] = location_info.get("road1")