pylint crashed with a AstroidError
(astroid.exceptions.ParentMissingError)
#7680
Labels
Crash 💥
A bug that makes pylint crash
Needs astroid update
Needs an astroid update (probably a release too) before being mergable
Needs investigation 🔬
A bug or crash where it's not immediately obvious what is happenning
Bug description
When trying to lint a file that contain the DeclarativeBase of the recent SQLAlchemy 2.0 (beta), it fails with an
astroid.exceptions.ParentMissingError: Parent not found on <Const.str l.None at 0x189844d3730>.
error. I was able to pin point the issue with the newsqlalchemy.orm.DeclarativeBase
.I understand this is most probably due to the new SQLAlchemy 2.0, but since the traceback point to pylint, I created to issue here. Maybe some guys from SQLAlchemy could help out here too? @CaselIT @zzzeek (hopefully that will ping them!)
Code that makes pylint crash
The code below is based on the migration guide and the declarative mixins.
The only difference I made is to put the mixin directly in the base.
Stacktrace
Code that works
Having the mixin code not in the Base seems to resolve the issue.
So does getting rid of
DeclarativeBase
Configuration
No response
Command used
Pylint output
Expected behavior
No issues found.
Pylint version
OS / Environment
Windows 10
Poetry
Additional dependencies
sqlalchemy = {version = "^2.0.0b2", allow-prereleases = true}
The text was updated successfully, but these errors were encountered: