from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
def spam(url):
engine = create_engine(url)
session = sessionmaker(bind=engine)()
query = session.query()
pylint -E test.py
************* Module test
test.py:7:12: E1101: Instance of 'Session' has no 'query' member (no-member)
With pylint 2.4.4, you don't get this error.
pylint 2.5.2
astroid 2.4.1
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
I confirm this regression with my code and the same configuration
Ditto for me as well. We had to revert to 2.4.4. We also git errors regarding __table___ not being a member of our table classes with the new version.
Same issue here. Additionally, accessing methods I add to the Base class (Base = declarative_base(engine)) give no-member when accessed through a child class:
Base.all = classmethod(all)
Base.by_id = classmethod(single_lookup(by_id))
[...]
These were not no-member'd in version 2.4.4.
There are also no-members being given for backref fields added by sqlalchemy.orm.relationship, and a multitude of other cases. Can also confirm @Syntactical01's issue with __table__.
same issue for me ..
Exactly same issue for me. Any clue when this will be fixed?
Bump: similar behavior on 2.3.1
Still an issue on 2.6.0
It seems that this bug has been fixed in astroid master branch thanks to the addition of a brain dedicated to SQLAlchemy. (Thanks @sscherfke PyCQA/astroid#787)
It will be available as soon as the 2.5 version of astroid聽will be released.
I close this issue.
Most helpful comment
It seems that this bug has been fixed in
astroidmaster branch thanks to the addition of a brain dedicated toSQLAlchemy. (Thanks @sscherfke PyCQA/astroid#787)It will be available as soon as the 2.5 version of
astroid聽will be released.I close this issue.