Skip to content

Commit

Permalink
Merge pull request #2667 from data-for-change/2666-modify-involved-to…
Browse files Browse the repository at this point in the history
…-accident-yishuv

Modify involve_yishuv_name to accident_yishuv_name in widgets filters
  • Loading branch information
atalyaalon committed Jun 5, 2024
2 parents 6304f0c + e8ccb19 commit 30fc234
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions anyway/widgets/urban_widgets/urban_crosswalk_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion anyway/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 30fc234

Please sign in to comment.