Spaces:
Build error
Build error
SnehaAkula
commited on
Commit
•
c60ac27
1
Parent(s):
0aee03f
Upload app.py
Browse files
app.py
CHANGED
@@ -246,14 +246,16 @@ def classify_claim():
|
|
246 |
|
247 |
record = grouped[grouped['case_id'] == case_id]
|
248 |
|
249 |
-
|
250 |
-
if record.empty:
|
251 |
-
return jsonify({"error": "No record found for the given case_id"}), 404
|
252 |
# Check if case_id is present
|
253 |
if case_id not in grouped['case_id'].values:
|
254 |
new_case_id = random.randint(100000, 999999)
|
255 |
return jsonify({"message": f"New Case: Customer id {case_id} not found. \n"
|
256 |
f"A new case has been created with Case ID: {new_case_id}." })
|
|
|
|
|
|
|
|
|
257 |
|
258 |
|
259 |
print("--"*2)
|
|
|
246 |
|
247 |
record = grouped[grouped['case_id'] == case_id]
|
248 |
|
249 |
+
|
|
|
|
|
250 |
# Check if case_id is present
|
251 |
if case_id not in grouped['case_id'].values:
|
252 |
new_case_id = random.randint(100000, 999999)
|
253 |
return jsonify({"message": f"New Case: Customer id {case_id} not found. \n"
|
254 |
f"A new case has been created with Case ID: {new_case_id}." })
|
255 |
+
|
256 |
+
# Check if the record is empty and return an appropriate response
|
257 |
+
if record.empty:
|
258 |
+
return jsonify({"error": "No record found for the given case_id"}), 404
|
259 |
|
260 |
|
261 |
print("--"*2)
|