Skip to content

Type inherited from reflected type cannot be directly queried #957

@dnwpark

Description

@dnwpark

Using the orm_qb schema, the following code:

from models.orm_qb import default, std

class Inh_A_WithComputed(default.Inh_A):
    n: std.int64

result = self.client.query(Inh_A_WithComputed)

Fails typecheck with:

error: Need type annotation for "result" (hint: "result: list[<type>] = ...")  [var-annotated]
error: Argument 1 to "query" of "ReadOnlyExecutor" has incompatible type "type[Inh_A_WithComputed]"; expected "QueryableObject[Never] | type[QueryableType[Never]]"  [arg-type]

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