Spaces:
Sleeping
Sleeping
fix rows
Browse files
app.py
CHANGED
|
@@ -73,12 +73,13 @@ def get_employee_job_title(first_name:str, last_name:str)-> str: #it's import to
|
|
| 73 |
cursor = conn.cursor()
|
| 74 |
|
| 75 |
cursor.execute(f"SELECT job_title FROM employees WHERE first_name='{first_name}' AND last_name='{last_name}'")
|
|
|
|
| 76 |
if len(rows) > 1:
|
| 77 |
return "Many employees with that name"
|
| 78 |
elif len(rows) == 0:
|
| 79 |
return "No employee with that name"
|
| 80 |
else:
|
| 81 |
-
row =
|
| 82 |
return row
|
| 83 |
|
| 84 |
final_answer = FinalAnswerTool()
|
|
|
|
| 73 |
cursor = conn.cursor()
|
| 74 |
|
| 75 |
cursor.execute(f"SELECT job_title FROM employees WHERE first_name='{first_name}' AND last_name='{last_name}'")
|
| 76 |
+
rows = cursor.fetchall()
|
| 77 |
if len(rows) > 1:
|
| 78 |
return "Many employees with that name"
|
| 79 |
elif len(rows) == 0:
|
| 80 |
return "No employee with that name"
|
| 81 |
else:
|
| 82 |
+
row = rows[0][0]
|
| 83 |
return row
|
| 84 |
|
| 85 |
final_answer = FinalAnswerTool()
|