sqlalchemy2-stubs icon indicating copy to clipboard operation
sqlalchemy2-stubs copied to clipboard

Incomplete typing for Engine.dispose's close parameter

Open satyanash opened this issue 2 years ago • 1 comments

Describe the bug SQLAlchemy release 1.4.33 added a new optional close: bool = True parameter to Engine#dispose(). This is not declared in the type definition, at https://github.com/sqlalchemy/sqlalchemy2-stubs/blob/dd0e6cf7e1c61cc1c25cd1d8d72c9f322fa73d90/sqlalchemy-stubs/engine/base.pyi#L200

Expected behavior The current type definition should declare the close parameter.

To Reproduce Call Engine.dispose(close) and then run mypy on it with sqlalchemy2-stubs.

engine.dispose(close=False)

Error

error: Too many arguments for "dispose" of "Engine"

Versions.

  • OS: Darwin Kernel Version 21.6.0
  • Python: 3.7.10
  • SQLAlchemy: 1.4.39
  • mypy: 0.931
  • SQLAlchemy2-stubs: 0.0.2a29

satyanash avatar Dec 12 '22 09:12 satyanash

Hi,

thanks for reporting. PRs welcomes to fix this

CaselIT avatar Dec 12 '22 19:12 CaselIT