From 19118ca18f09067f623e4c39b71e2e786b4421a9 Mon Sep 17 00:00:00 2001
From: TeachMeTW <robin@robinttw.com>
Date: Mon, 6 Jan 2025 09:17:41 -0800
Subject: [PATCH] Modified userstat where it passes in the trip_key as an input
 instead of hardcoding analysis/confirmed_trip

---
 emission/analysis/result/user_stat.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emission/analysis/result/user_stat.py b/emission/analysis/result/user_stat.py
index fa1d7ac95..27d633cec 100644
--- a/emission/analysis/result/user_stat.py
+++ b/emission/analysis/result/user_stat.py
@@ -61,9 +61,9 @@ def get_and_store_user_stats(user_id: str, trip_key: str) -> None:
         end_ts_result = ts.get_first_value_for_field(trip_key, "data.end_ts", pymongo.DESCENDING)
         end_ts = None if end_ts_result == -1 else end_ts_result
 
-        total_trips = ts.find_entries_count(key_list=["analysis/confirmed_trip"])
+        total_trips = ts.find_entries_count(key_list=[trip_key])
         labeled_trips = ts.find_entries_count(
-            key_list=["analysis/confirmed_trip"],
+            key_list=[trip_key],
             extra_query_list=[{'data.user_input': {'$ne': {}}}]
         )