-
Notifications
You must be signed in to change notification settings - Fork 25
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
Rework the histogram activity chart #5685
base: main
Are you sure you want to change the base?
Conversation
rowanseymour
commented
Nov 22, 2024
•
edited
Loading
edited
- Max date is always today.
- Min date is at least 90 days in past.
- Bucket to months or weeks depending on how long we have data for.
@@ -2888,9 +2887,6 @@ def test_results(self): | |||
self.assertEqual("Color", counts[0]["name"]) | |||
self.assertEqual(2, counts[0]["total"]) | |||
|
|||
FlowCRUDL.ActivityChart.HISTOGRAM_MIN = 0 | |||
FlowCRUDL.ActivityChart.PERIOD_MIN = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are always zero...
@@ -1279,13 +1281,11 @@ def render_to_response(self, context, **response_kwargs): | |||
|
|||
return JsonResponse( | |||
{ | |||
"start_date": start_date, | |||
"end_date": end_date, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used
temba/utils/tests.py
Outdated
(date(2024, 1, 2), "week", date(2024, 1, 1)), | ||
(date(2023, 1, 2), "week", date(2023, 1, 2)), | ||
(date(2022, 1, 2), "week", date(2021, 12, 27)), | ||
(date(2021, 1, 2), "week", date(2020, 12, 28)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checked all these against Postgres
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5685 +/- ##
===========================================
- Coverage 100.00% 99.99% -0.01%
===========================================
Files 571 571
Lines 25923 25920 -3
===========================================
- Hits 25923 25918 -5
- Misses 0 2 +2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
984145c
to
59ccac8
Compare
def get_date_counts(self, exit_uuids: list, truncate: str) -> list[tuple]: | ||
dates = ( | ||
self.object.path_counts.filter(from_uuid__in=exit_uuids) | ||
.extra({"date": f"date_trunc('{truncate}', period::date)"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be able to replicate this with new counts by doing something similiar to how we extract team id from scope for tickert counts by team