sqlalchemy warnings
PyCharm is warning me about valid code constructs using sqlalchemy. Here's three examples:
Warning: "Unresolved attribute reference 'is_' for class 'bool'" - the ".is_" is a valid construction
.filter(NoteColours.enabled.is_(True))
Warning: "Unresolved attribute reference 'desc' for class 'datetime'" - the "desc()" sorts the query in descending order:
.order_by(cls.last_used.desc())
Warning: "Unresolved attribute reference 'ilike' for class 'str' - again, ilike is a valid construction:
.filter(Tracks.title.ilike(text))
Any fixes for the extraneous warnings?
请先登录再写评论。
Hi, does it help to install sqlalchemy-stubs package?
If not, I suggest to report the issue to our issue tracker https://youtrack.jetbrains.com with a minimal working code sample and your PyCharm version.
Also, please be aware of the other SqlAlchemy issues.
Your issue may be already reported, but it's hard to tell without a code sample.
That fixed it! Thank you!
I'm not sure why but this problem has resurfaced. I have sqlalchemy-stubs installed as listed Project, Python Interpreter. I can see definitions for 'ilike', 'is_', etc, in the stub file, but PyCharm is warning about Unresolved attribute reference for 'ilike', 'is_', etc.
It's as if PyCharm is not reading the stubs file. What troubleshooting steps can I take to help resolve this?
Thanks,
Keith
You can try using **File | Repair IDE...**.
Also, where are you navigated to when using Go to Declaration on this module?