-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
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
Type is not callable error using SQLAlchemy's declarative_base #507
Comments
Thanks for the bug report. SqlAlchemy is using a custom metaclass that provides non-standard behaviors for a constructor. I've changed the logic in pylance to avoid emitting this particular error when a class is instantiated from a custom metaclass, so you won't see this false positive in the future. This fix will be in the next release of pylance. |
This issue has been fixed in version 2020.10.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#2020102-21-october-2020 |
This issue has been fixed in version 2020.10.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#2020103-28-october-2020 |
I still get the "Expected no arguments" bug on SQLAlchemy model class initialization. (running Pylance 2020.11.1) |
I just re-verified that the code sample above does not result in any errors. If your code differs from the above, please post a simple example that exhibits the problem. |
Sorry about the trouble Eric, the errors are gone now. I think my workspace just wasn't pointed at my virtualenv's Python interpreter. |
Environment data
Expected behaviour
No errors.
Actual behaviour
Two errors appear:
Code Snippet / Additional information
SQLAlchemy's declarative_base should use this _declarative_constructor by default, which allows initialization from kwargs.
There are no errors for the same snippet using standalone Pyright (1.1.80) without Pylance.
The text was updated successfully, but these errors were encountered: