If an .edgeql contains a variable named $query codegen should raise an error or otherwise avoid the collision with the existing query argument of the edgedb.AsyncIOExecutor.query() method (whose signature looks like this: async def query(self, query: str, *args, **kwargs) -> list:)
**More Details***
See Issue #496.
I have an .edgeql that looks like this: select ext::ai::search(MyModel, <array<float32>>$query)
edgeql-py generates python code that looks like this:
The problem is that the first argument of edgedb.AsyncIOExecutor.query() is named query, which means that the use of the named argument actually overwrites the first. For example, what is really going on is this (note that query is being passed twice).
Then, I get a runtime error stating: TypeError: AsyncIOReadOnlyExecutor.query() got multiple values for argument 'query' -- it wasn't obvious to me what was going on, since my query argument was a list[float] and I thought it was a problem with it being a list. I didn't realize the root of the problem.
Describe the bug
If an
.edgeql
contains a variable named$query
codegen should raise an error or otherwise avoid the collision with the existingquery
argument of theedgedb.AsyncIOExecutor.query()
method (whose signature looks like this:async def query(self, query: str, *args, **kwargs) -> list:
)**More Details***
See Issue #496.
I have an
.edgeql
that looks like this:select ext::ai::search(MyModel, <array<float32>>$query)
edgeql-py
generates python code that looks like this:The problem is that the first argument of
edgedb.AsyncIOExecutor.query()
is namedquery
, which means that the use of the named argument actually overwrites the first. For example, what is really going on is this (note that query is being passed twice).Then, I get a runtime error stating:
TypeError: AsyncIOReadOnlyExecutor.query() got multiple values for argument 'query'
-- it wasn't obvious to me what was going on, since myquery
argument was alist[float]
and I thought it was a problem with it being a list. I didn't realize the root of the problem.