Skip to content

Directly querying user defined function returning optional fails typecheck #958

Description

@dnwpark

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].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ORMbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions