Spaces:
Running
Running
Handle invalid analytics in session results
Browse files1034 unmodified lines10351036103710381039104010411034 unmodified linesif report.get("error"):failed.append({"id": str(uuid5(session_id, str(index))), "label": label, "start": str(start), "end": str(end), "error": report["error"]})continueanalytics = report.get("analytics") or {}metrics = [{"name": key.replace("_", " ").title(), "value": value, "unit": ""} for key, value in analytics.items() if isinstance(value, (int, float, str, bool)) or value is None]full_interval = report.get("full_interval") or {}telemetry_names = {1034 unmodified lines10351036103710381039104010411042104310441045104610471048104910501034 unmodified linesif report.get("error"):failed.append({"id": str(uuid5(session_id, str(index))), "label": label, "start": str(start), "end": str(end), "error": report["error"]})continueanalytics = report.get("analytics")if isinstance(analytics, str):failed.append({"id": str(uuid5(session_id, str(index))), "label": label,"start": str(start), "end": str(end), "error": analytics})continueif not isinstance(analytics, dict):failed.append({"id": str(uuid5(session_id, str(index))), "label": label,"start": str(start), "end": str(end),"error": "Analysis data is incomplete; no valid analytics were saved for this action."})continuemetrics = [{"name": key.replace("_", " ").title(), "value": value, "unit": ""} for key, value in analytics.items() if isinstance(value, (int, float, str, bool)) or value is None]full_interval = report.get("full_interval") or {}telemetry_names = {
app.py+10-1