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
Describe the bug mypy doesn't allow Delete() as parameter to op.execute().
Expected behavior no mypy error?
To Reproduce
from alembic import op from sqlalchemy import table op.execute(table("test").delete())
Error
test.py:3: error: Argument 1 to "execute" has incompatible type "Delete"; expected "Union[str, TextClause, Update]"
Versions.
Have a nice day! Thanks!
The text was updated successfully, but these errors were encountered:
Maybe in ddl/impl.py:
ddl/impl.py
def execute( self, - sql: Union["Update", "TextClause", str], + sql: Union["UpdateBase", "TextClause", str], execution_options: None = None, ) -> None: self._exec(sql, execution_options)
Sorry, something went wrong.
agree, "Update" seems kind of arbitrary. I would think Executable is the safer choice
cc @CaselIT
That type probably was the one auto-generated from the tests. We can do executable|str
executable|str
This is actually the same as #1277
Mihail Milushev has proposed a fix for this issue in the main branch:
Improve typing of op.execute https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4835
op.execute
b208733
ruff
No branches or pull requests
Describe the bug
mypy doesn't allow Delete() as parameter to op.execute().
Expected behavior
no mypy error?
To Reproduce
Error
Versions.
Have a nice day!
Thanks!
The text was updated successfully, but these errors were encountered: