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

Rework the histogram activity chart #5685

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rowanseymour
Copy link
Member

@rowanseymour rowanseymour commented Nov 22, 2024

  • 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
Copy link
Member Author

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,
Copy link
Member Author

Choose a reason for hiding this comment

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

not used

(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)),
Copy link
Member Author

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

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.99%. Comparing base (75b2a5c) to head (59ccac8).

Files with missing lines Patch % Lines
temba/flows/views.py 90.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

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)"})
Copy link
Member Author

@rowanseymour rowanseymour Nov 22, 2024

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

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.

1 participant