From 7593acf62c4793e6300126a222c9e14d4b34783d Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Thu, 5 Feb 2026 17:26:34 +0000 Subject: [PATCH] feat: add endpoint to view dataset for debug --- server/app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/app.py b/server/app.py index 4a93b89..e85adb0 100644 --- a/server/app.py +++ b/server/app.py @@ -40,6 +40,13 @@ def upload_data(): return jsonify({"error": f"Failed to read JSONL file: {str(e)}"}), 400 except Exception as e: return jsonify({"error": f"An unexpected error occurred: {str(e)}"}), 500 + +@app.route('/dataset', methods=['GET']) +def get_dataset(): + if stat_obj is None: + return jsonify({"error": "No data uploaded"}), 400 + + return jsonify(stat_obj.df.to_dict(orient="records")), 200 @app.route('/stats/content', methods=['GET']) def word_frequencies():