Skip to content

Conversation

jd-solanki
Copy link

Hi @frankie567 👋🏻

I've been playing with fastapi-users and I have to remove unique constaint on email col due to soft deletes. Hence, I added my own email col however as I've email col like this:

    email: Mapped[str] = mapped_column(
        String(length=320),
        index=True,
        nullable=False,
        kw_only=True,
    )

'm getting error from pylance `Override type "Mapped[str]" is not the same as base type:
image

Hence, I added unique of Mapped as well.

However, I can't understand why we need seperate if TYPE_CHECKING:? If we directly write cols like normal table it should work. If removing if TYPE_CHECKING: we can reject this PR as problem should solve automatically as now type will be same.

Big Thanks for this lib ❤️

@jd-solanki
Copy link
Author

I'm not expert here but I guess this also relates to UserProtocol in models.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant