-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
SQLAlchemy: Instance of 'sessionmaker' has no 'begin' member #7090
Comments
We have several open issues for SQLAlchemy, which points to the need for a third party project for this inspired by Here, we just don't know that As a workaround, you can invoke pylint with |
@jacobtylerwalls thank you for the explanation and for the info on how to workaround the issue. |
Same is true for
Leads to
So here again astroid/pylint isn't able to determine the correct stuff. |
@jacobtylerwalls Either I'm missing something, or that's exactly what this is: https://github.com/sqlalchemy/sqlalchemy/blob/ca813b33f5447e592eace3117f3521a007f30b60/lib/sqlalchemy/orm/session.py#L5057 |
@CarliJoy for “normal” SQL functions — have you tried >>> import sqlalchemy.sql.functions
>>> sqlalchemy.sql.functions.count
<class 'sqlalchemy.sql.functions.count'> instead of the func function generator? @neilmunday @jacobtylerwalls oddly enough, this one lints just fine: with Session() as session:
with session.begin():
... For more details on the difference between |
Thanks for the workaround! Based on the helpful link from @scribblemaniac, I think |
Bug description
When using SQL Alchemy's
sessionmaker.begin
functionailty (ref: https://docs.sqlalchemy.org/en/14/orm/session_api.html#sqlalchemy.orm.sessionmaker.begin),pylint
outputs the following errors:Example:
Configuration
No response
Command used
Pylint output
Expected behavior
pylint
should not output errors forsqlalchemy.orm.sessionmaker.begin
.Pylint version
OS / Environment
Fedora 34, BASH shell.
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: