We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sessionmaker
**kw
Describe the bug The annotation for one of sessionmaker's overloads seems to be missing the **kw: Any parameter, causing the code below to fail.
**kw: Any
Expected behavior Mypy shouldn't complain when calling sessionmaker with the future=True flag.
future=True
To Reproduce
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///', future=True) Session = sessionmaker(engine, future=True)
Error
foo.py:6: error: No overload variant of "sessionmaker" matches argument types "Engine", "bool" foo.py:6: note: Possible overload variants: foo.py:6: note: def [_TSessionMakerType] __init__(self, bind: Union[Connection, Engine, None] = ..., class_: None = ..., autoflush: bool = ..., autocommit: bool = ..., expire_on_commit: bool = ..., info: Optional[Mapping[Any, Any]] = ...) -> sessionmaker[Session] foo.py:6: note: def [_TSessionMakerType] __init__(self, bind: Union[Connection, Engine, AsyncConnection, AsyncEngine, None], class_: Type[_TSessionMakerType], autoflush: bool = ..., autocommit: bool = ..., expire_on_commit: bool = ..., info: Optional[Mapping[Any, Any]] = ..., **kw: Any) -> sessionmaker[_TSessionMakerType] foo.py:6: note: def [_TSessionMakerType] __init__(self, *, bind: Union[Connection, Engine, AsyncConnection, AsyncEngine, None] = ..., class_: Type[_TSessionMakerType], autoflush: bool = ..., autocommit: bool = ..., expire_on_commit: bool = ..., info: Optional[Mapping[Any, Any]] = ..., **kw: Any) -> sessionmaker[_TSessionMakerType] Found 1 error in 1 file (checked 1 source file)
Versions.
Have a nice day!
The text was updated successfully, but these errors were encountered:
Add missing **kw argument to orm.sessionmaker. Fixes sqlalchemy#84
orm.sessionmaker
2845be2
Add missing **kw argument to orm.sessionmaker. Fixes #84 (#85)
158ee15
Successfully merging a pull request may close this issue.
Describe the bug
The annotation for one of sessionmaker's overloads seems to be missing the
**kw: Any
parameter, causing the code below to fail.Expected behavior
Mypy shouldn't complain when calling
sessionmaker
with thefuture=True
flag.To Reproduce
Error
Versions.
Have a nice day!
The text was updated successfully, but these errors were encountered: