How do I get code completion to work for SQLAlchemy?

Is there a working example of SQLAlchemy in PyCharm? I am trying to get code completion to work, but it only seems to work for some functions. For example, in the follow screenshot, I would expect typing ```session.``` would bring up a list of functions available to session, but it doesn't.

 

 

However, if I type-hint the session:

session = Session() # type: sqlalchemy.orm.Session

.It seems to work fine

 

However, I don't want to have to type-hint everything, as I'm not always sure what the type will be and if I type-hint the query object, objects further down the chain still don't get type-hinted.

What is the correct way to write my project so that type-hinting/code completion works property? I'd like this to work because it makes learning the package much easier.

2
2 comments

Hello, 

 

This is a known issue please see https://youtrack.jetbrains.com/issue/PY-31296 , feel free to vote for it in order to increase its priority. 

 

Apologies for the inconvenience. 

 

 

0

This is still an issue that hasn't been resolved, will this be solved?

0

Please sign in to leave a comment.