Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2276 #2289

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

elazarg
Copy link

@elazarg elazarg commented Nov 4, 2022

Also

  • Simplify KilledAndInjuredCountPerAgeGroupWidgetUtils
  • Avoid adding leading zeros for groups
  • i18n for "unknown"

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Base: 55.36% // Head: 55.34% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (4763404) compared to base (0c0c401).
Patch coverage: 57.14% of modified lines in pull request are covered.

❗ Current head 4763404 differs from pull request most recent head 6a6904f. Consider uploading reports for the commit 6a6904f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2289      +/-   ##
==========================================
- Coverage   55.36%   55.34%   -0.02%     
==========================================
  Files         109      109              
  Lines        8654     8638      -16     
==========================================
- Hits         4791     4781      -10     
+ Misses       3863     3857       -6     
Flag Coverage Δ
unittests 55.34% <57.14%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ed_and_injured_count_per_age_group_widget_utils.py 70.90% <55.00%> (+4.75%) ⬆️
..._and_injured_count_per_age_group_stacked_widget.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@atalyaalon atalyaalon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

widget generation fails - for example try querying locally
localhost:8080/api/infographics-data?news_flash_id=16577&years_ago=5&lang=he

anyway               | Traceback (most recent call last):
anyway               |   File "/anyway/anyway/widgets/widget.py", line 92, in generate_widget_data
anyway               |     w.generate_items()
anyway               |   File "/anyway/anyway/widgets/suburban_widgets/killed_and_injured_count_per_age_group_stacked_widget.py", line 30, in generate_items
anyway               |     raw_data = KilledAndInjuredCountPerAgeGroupWidgetUtils.filter_and_group_injured_count_per_age_group(
anyway               |   File "/anyway/anyway/widgets/suburban_widgets/killed_and_injured_count_per_age_group_widget_utils.py", line 41, in filter_and_group_injured_count_per_age_group
anyway               |     dict_grouped = KilledAndInjuredCountPerAgeGroupWidgetUtils.parse_query_data(query)
anyway               |   File "/anyway/anyway/widgets/suburban_widgets/killed_and_injured_count_per_age_group_widget_utils.py", line 71, in parse_query_data
anyway               |     dict_grouped[group_name][row.injury_severity] += row.count
anyway               | KeyError: '0-5'

else:
age_list.append(f"{item_min_range:02}-{item_max_range:02}")

return age_list
Copy link
Author

@elazarg elazarg Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason there's no "Unknown" here. I did not change that.

@elazarg elazarg force-pushed the revert-2284-revert-2282-patch-5 branch from f3afb81 to 6a6904f Compare November 24, 2022 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants