You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No red squiggly lines around User to warn about error "Expected no arguments to "User" constructor". I've seen #507 and for SQL Alchemy models there's no squiggly lines but this isn't true for Flask-SQLAlchemy models, even if following Flask documentation.
Actual behavior
The text was updated successfully, but these errors were encountered:
@senese, for Pylance to believe that that User has a generated __init__ method with id, username, and email parameters, User or one of its base classes would need to be decorated with dataclass_transform. From what I can tell, it is not.
I'd suggest filing an issue on flask_sqlalchemy.
I also want to point it out that when using unpacking syntax it doesn't raise any warnings or errors:
I think this is because there's no diagnostic when an unpacked dict contains extra fields that don't match parameters on the target function. For example:
params= {"foobar": 1}
user=User(**params) # no diagnostics
Environment data
Code Snippet
Output:
<User (transient 139732127139744)>
Expected behavior
No red squiggly lines around User to warn about error "Expected no arguments to "User" constructor". I've seen #507 and for SQL Alchemy models there's no squiggly lines but this isn't true for Flask-SQLAlchemy models, even if following Flask documentation.
Actual behavior
The text was updated successfully, but these errors were encountered: