h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Docs wrong for dropping all cards #2319

Closed mtanco closed 2 months ago

mtanco commented 2 months ago

Wave SDK Version, OS

image

This is not an await function, so docs are wrong

@app("/")
async def serve(q: Q):

    await q.page.drop()

    await q.page.save()  # Update the UI
Error
Traceback (most recent call last):
  File "/Users/mtanco/PycharmProjects/att_training/.venv/lib/python3.12/site-packages/h2o_wave/server.py", line 360, in _process
    await self._handle(q)
  File "/Users/mtanco/PycharmProjects/att_training/chat.py", line 22, in serve
    await q.page.drop()
TypeError: object NoneType can't be used in 'await' expression

works if you remove await

marek-mihok commented 2 months ago

@mtanco, thanks for noticing!