edgedb-python icon indicating copy to clipboard operation
edgedb-python copied to clipboard

Creating an object and passing no props crashes with EdgeQLSyntaxError

Open anbuzin opened this issue 5 months ago • 0 comments

Schema:

module default {
    type Chat {
        content: str;
    }
}

Python:

from models import default
import gel
import asyncio


client = gel.create_async_client()


async def main():
    chat = default.Chat()
    await client.save(chat)


if __name__ == "__main__":
    asyncio.run(main())

Error:

Traceback (most recent call last):
  File "/Users/andrey/local/projects/python_api_dogfooded/repros/main.py", line 15, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "/Users/andrey/.local/share/uv/python/cpython-3.13.3-macos-aarch64-none/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/Users/andrey/.local/share/uv/python/cpython-3.13.3-macos-aarch64-none/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/andrey/.local/share/uv/python/cpython-3.13.3-macos-aarch64-none/lib/python3.13/asyncio/base_events.py", line 719, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/Users/andrey/local/projects/python_api_dogfooded/repros/main.py", line 11, in main
    await client.save(chat)
  File "/Users/andrey/local/projects/python_api_dogfooded/repros/.venv/lib/python3.13/site-packages/gel/asyncio_client.py", line 530, in save
    batch_ids = await tx.wait()
                ^^^^^^^^^^^^^^^
  File "/Users/andrey/local/projects/python_api_dogfooded/repros/.venv/lib/python3.13/site-packages/gel/asyncio_client.py", line 459, in wait
    return await self._connection.batch_query(ops)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andrey/local/projects/python_api_dogfooded/repros/.venv/lib/python3.13/site-packages/gel/base_client.py", line 287, in batch_query
    rv = await self._protocol.batch_execute(ctxs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "gel/protocol/protocol.pyx", line 884, in batch_execute
  File "gel/protocol/protocol.pyx", line 541, in _parse_batch
gel.errors.EdgeQLSyntaxError: parametrized type must have at least one argument
  ┌─ query:3:48
  │
3 │                   with __all_data := <array<tuple<>>>$0
  │                                                  ^ error

anbuzin avatar Jun 19 '25 10:06 anbuzin