From f3135b646e088c602beb24939793c934b70827e8 Mon Sep 17 00:00:00 2001 From: abram axel booth Date: Thu, 17 Oct 2024 16:11:44 -0400 Subject: [PATCH] update make_dummy_pageviews_for_metrics for reports --- osf/management/commands/make_dummy_pageviews_for_metrics.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osf/management/commands/make_dummy_pageviews_for_metrics.py b/osf/management/commands/make_dummy_pageviews_for_metrics.py index 11ff9ca69c9..09de34bf7a8 100644 --- a/osf/management/commands/make_dummy_pageviews_for_metrics.py +++ b/osf/management/commands/make_dummy_pageviews_for_metrics.py @@ -74,6 +74,8 @@ def _generate_random_countedusage(self, n, max_age): item_guid=ITEM_GUID, session_id='freshen by key', user_is_authenticated=bool(random.randint(0, 1)), + item_public=bool(random.randint(0, 1)), + action_labels=[['view', 'download'][random.randint(0, 1)]], ) def _run_date_query(self, time_range_filter): @@ -103,8 +105,8 @@ def _run_date_query(self, time_range_filter): }, }) return { - 'min': result.aggs['min-timestamp'].value_as_string, - 'max': result.aggs['max-timestamp'].value_as_string, + 'min': result.aggs['min-timestamp'].value, + 'max': result.aggs['max-timestamp'].value, **{ str(bucket.key.date()): bucket.doc_count for bucket in result.aggs['by-date']