Spaces:
Sleeping
Sleeping
matthew.farant commited on
Commit ·
1213c54
1
Parent(s): e8ef367
adjustment
Browse files- app/utils.py +8 -8
app/utils.py
CHANGED
|
@@ -1025,24 +1025,24 @@ def get_user_life_status(user_id):
|
|
| 1025 |
# Sum points_added, group by area
|
| 1026 |
temp_df = pd.DataFrame(filtered_data)
|
| 1027 |
grouped_points = temp_df.groupby("area")["points_added"].sum()
|
| 1028 |
-
|
| 1029 |
# Debug: Check the grouped points result
|
| 1030 |
logger.info(f"Grouped Points: {grouped_points}", extra={'user_id': user_id, 'endpoint': function_name})
|
| 1031 |
|
| 1032 |
# Structure the output safely
|
| 1033 |
thirtydays_life_score = {
|
| 1034 |
-
"overall": sum([
|
| 1035 |
grouped_points.get("personal_growth", 0),
|
| 1036 |
grouped_points.get("career_growth", 0),
|
| 1037 |
grouped_points.get("health_and_wellness", 0),
|
| 1038 |
grouped_points.get("mental_well_being", 0),
|
| 1039 |
grouped_points.get("relationship", 0),
|
| 1040 |
-
]),
|
| 1041 |
-
"personal_growth": grouped_points.get("personal_growth", 0),
|
| 1042 |
-
"health_and_wellness": grouped_points.get("health_and_wellness", 0),
|
| 1043 |
-
"mental_well_being": grouped_points.get("mental_well_being", 0),
|
| 1044 |
-
"career_growth": grouped_points.get("career_growth", 0),
|
| 1045 |
-
"relationship": grouped_points.get("relationship", 0)
|
| 1046 |
}
|
| 1047 |
|
| 1048 |
# Debug: Check the final structured result
|
|
|
|
| 1025 |
# Sum points_added, group by area
|
| 1026 |
temp_df = pd.DataFrame(filtered_data)
|
| 1027 |
grouped_points = temp_df.groupby("area")["points_added"].sum()
|
| 1028 |
+
|
| 1029 |
# Debug: Check the grouped points result
|
| 1030 |
logger.info(f"Grouped Points: {grouped_points}", extra={'user_id': user_id, 'endpoint': function_name})
|
| 1031 |
|
| 1032 |
# Structure the output safely
|
| 1033 |
thirtydays_life_score = {
|
| 1034 |
+
"overall": int(sum([
|
| 1035 |
grouped_points.get("personal_growth", 0),
|
| 1036 |
grouped_points.get("career_growth", 0),
|
| 1037 |
grouped_points.get("health_and_wellness", 0),
|
| 1038 |
grouped_points.get("mental_well_being", 0),
|
| 1039 |
grouped_points.get("relationship", 0),
|
| 1040 |
+
])),
|
| 1041 |
+
"personal_growth": int(grouped_points.get("personal_growth", 0)),
|
| 1042 |
+
"health_and_wellness": int(grouped_points.get("health_and_wellness", 0)),
|
| 1043 |
+
"mental_well_being": int(grouped_points.get("mental_well_being", 0)),
|
| 1044 |
+
"career_growth": int(grouped_points.get("career_growth", 0)),
|
| 1045 |
+
"relationship": int(grouped_points.get("relationship", 0))
|
| 1046 |
}
|
| 1047 |
|
| 1048 |
# Debug: Check the final structured result
|