We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
I'm getting a Type "Mapped[int]" is not hashable error in Pyright when trying to use a column in a dictionary.
Type "Mapped[int]" is not hashable
Expected behavior
Pyright should not report an error.
To Reproduce
from sqlalchemy import Column, Integer from sqlalchemy.orm import Mapped class MyModel: id: Mapped[int] = Column("id", Integer, primary_key=True) data = {MyModel.id: 1}
Error
/path/to/file.py /path/to/file.py:9:9 - error: Dictionary key must be hashable Type "Mapped[int]" is not hashable (reportGeneralTypeIssues)
Versions.
Additional context
This is caused by the lack of __hash__ in ColumnOperators.
__hash__
ColumnOperators
The issue does not appear when using SA because __hash__ has been added there.
The text was updated successfully, but these errors were encountered:
Add ColumnOperators.__hash__ (fixes sqlalchemy#262)
5c3ba15
d71cd0e
No branches or pull requests
Describe the bug
I'm getting a
Type "Mapped[int]" is not hashable
error in Pyright when trying to use a column in a dictionary.Expected behavior
Pyright should not report an error.
To Reproduce
Error
Versions.
Additional context
This is caused by the lack of
__hash__
inColumnOperators
.The issue does not appear when using SA because
__hash__
has been added there.The text was updated successfully, but these errors were encountered: