You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"\"SELECT flight_id FROM tickets WHERE ticket_no = ? AND passenger_id = ?\",\n",
@tooldefcancel_ticket(ticket_no: str, *, config: RunnableConfig) ->str:
"""Cancel the user's ticket and remove it from the database."""configuration=config.get("configurable", {})
passenger_id=configuration.get("passenger_id", None)
ifnotpassenger_id:
raiseValueError("No passenger ID configured.")
conn=sqlite3.connect(db)
cursor=conn.cursor()
cursor.execute(
"SELECT flight_id FROM ticket_flights WHERE ticket_no = ?", (ticket_no,)
)
existing_ticket=cursor.fetchone()
ifnotexisting_ticket:
cursor.close()
conn.close()
return"No existing ticket found for the given ticket number."# Check the signed-in user actually has this ticketcursor.execute(
"SELECT flight_id FROM tickets WHERE ticket_no = ? AND passenger_id = ?",
(ticket_no, passenger_id),
)
current_ticket=cursor.fetchone()
ifnotcurrent_ticket:
cursor.close()
conn.close()
returnf"Current signed-in passenger with ID {passenger_id} not the owner of ticket {ticket_no}"cursor.execute("DELETE FROM ticket_flights WHERE ticket_no = ?", (ticket_no,))
conn.commit()
cursor.close()
conn.close()
return"Ticket successfully cancelled."
'flight_id' do not exist in table 'tickets'
fix:
"SELECT flight_id FROM tickets WHERE ticket_no = ? AND passenger_id = ?"
change to:
"SELECT * FROM tickets WHERE ticket_no = ? AND passenger_id = ?"
Idea or request for content:
No response
The text was updated successfully, but these errors were encountered:
Issue with current documentation:
example code:
langgraph/docs/docs/tutorials/customer-support/customer-support.ipynb
Line 447 in 837f215
'flight_id' do not exist in table 'tickets'
fix:
Idea or request for content:
No response
The text was updated successfully, but these errors were encountered: