Появляется ошибка
sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type
, насколько я понимаю - косяк с типом данных ?
Сам код
@dp.message_handler(state=UserState.choice)
async def go(message: types.Message, state:FSMContext):
await state.update_data(choice=message.text)
data = await state.get_data()
if message.text=='Да!':
print(data['cat_id'])
print(data['town'])
with sqlite3.connect ('database.db') as connection:
cursor = connection.cursor()
cursor.execute("""
SELECT * FROM DataBase WHERE Category = (?) AND City = (?)
""", ({data['cat_id']}, {data['town']}, ))
result = cursor.fetchall()
print(result)
Что выдает терминал:
Task exception was never retrieved
future: <Task finished name='Task-24' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Denis\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py:407> exception=InterfaceError('Error binding parameter 0 - probably unsupported type.')>
Traceback (most recent call last):
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "C:\Users\Denis\AppData\Local\Programs\Python\Python38-32\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "C:\Apartment_Parsing\test2.py", line 73, in go
cursor.execute("""
sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.