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
create_check_constraint's condition argument is declared as condition: Union[str, BinaryExpression], which doesn't accept neither or_(…)/and_(…)
create_check_constraint
condition
condition: Union[str, BinaryExpression]
or_(…)
and_(…)
error: Argument 3 to "create_check_constraint" has incompatible type "ColumnElement[bool]"; expected "str | BinaryExpression[Any] | TextClause" [arg-type]
nor col_expr1 | col_expr2/col_expr1 & col_expr2:
col_expr1 | col_expr2
col_expr1 & col_expr2
error: Argument 3 to "create_check_constraint" has incompatible type "BooleanClauseList"; expected "str | BinaryExpression[Any] | TextClause" [arg-type]
Expected behavior
Both described cases work runtime, so type annotation is expected to allow them.
To Reproduce
from alembic import op import sqlalchemy as sa def upgrade() -> None: op.create_check_constraint( "check_constraint", "table_name", sa.or_(sa.column("a") != 0, sa.column("b") != 0), )
Error
Versions.
Additional context
Have a nice day!
The text was updated successfully, but these errors were encountered:
if it says "BinaryExpression" that's straight up wrong and seems like an automated tool generated that
Sorry, something went wrong.
Federico Caselli has proposed a fix for this issue in the main branch:
Improve typings https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4836
5628a22
No branches or pull requests
Describe the bug
create_check_constraint
'scondition
argument is declared ascondition: Union[str, BinaryExpression]
, which doesn't accept neitheror_(…)
/and_(…)
nor
col_expr1 | col_expr2
/col_expr1 & col_expr2
:Expected behavior
Both described cases work runtime, so type annotation is expected to allow them.
To Reproduce
Error
Versions.
Additional context
Have a nice day!
The text was updated successfully, but these errors were encountered: