Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make Column and relationship inherit from Mapped #235

Copy link
Copy link

Description

@mehdigmira
Issue body actions

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!

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't workingmissing typesomething is missing from the typessomething 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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.