Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/tkalir/anyway into 2648-addi…
Browse files Browse the repository at this point in the history
…ng_endpoints_for_location_debugging
  • Loading branch information
tkalir committed May 15, 2024
2 parents 4ed78d4 + 3bd68be commit 5136d44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion anyway/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def set_critical(
resolution = BE_CONST.ResolutionCategories(self.resolution)
end_time = last_accident_date.to_pydatetime().date()
start_time = datetime.date(end_time.year + 1 - years_before, 1, 1)
location_info = LocationInfo()
location_info: LocationInfo = {}
if resolution == BE_CONST.ResolutionCategories.SUBURBAN_ROAD:
location_info["road1"] = self.road1
location_info["road_segment_id"] = self.road_segment_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def filter_and_group_injured_count_per_age_group(
) -> Dict[str, Dict[int, int]]:
start_time = request_params.start_time
end_time = request_params.end_time
cache_key = None #prevent pylint warning

if request_params.resolution == BE_CONST.ResolutionCategories.STREET:
involve_yishuv_name = request_params.location_info["yishuv_name"]
street1_hebrew = request_params.location_info["street1_hebrew"]
Expand Down
1 change: 1 addition & 0 deletions tests/test_news_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def test_twitter_parse():
for k in raw_fields:
assert getattr(actual, k) == getattr(expected, k)

actual.set_critical()
actual.accident = classify_tweets(actual.description)
assert actual.accident == expected.accident

Expand Down

0 comments on commit 5136d44

Please sign in to comment.