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

Directly querying user defined function returning optional fails typecheck

Open dnwpark opened this issue 2 months ago • 0 comments

Given a schema:

function MaybeInt() -> optional int64 using (1);

Trying to query a call to the function:

result = self.client.query(default.MaybeInt())

Fails typechecking with the error:

error: Argument 1 to "query" of "ReadOnlyExecutor" has incompatible type "type[int64] | None"; expected "QueryableObject[int] | type[QueryableType[int]]"  [arg-type]

Note, the query correctly returns [1].

dnwpark avatar Oct 23 '25 19:10 dnwpark