Skip to content

Make Column and relationship inherit from Mapped #235

Open
@mehdigmira

Description

@mehdigmira

Is your feature request related to a problem? Please describe.

A typical typed SQLAlchemy model looks like this:

class Model(Base):
    name: Mapped[str] = Column(Unicode(100), nullable=True)

This works fine with mypy, but triggers the following error with Pylance/Pyright

Expression of type "Column[Unicode]" cannot be assigned to declared type "Mapped[str]"

Same for relationship

Describe the solution you'd like

Make Column and relationship inherit from Mapped

Additional context

I can make a PR if you're okay with this.

Have a nice day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmissing typesomething is missing from the types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions