Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 5b79426

Browse files
committed
chore: ignore booleans
1 parent de91784 commit 5b79426

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,12 @@ def visit_column_type(
18901890
def _format_alter_column(
18911891
compiler, table_name, schema, column_name, type_, nullable, server_default
18921892
):
1893+
# Older versions of SQLAlchemy pass in a boolean to indicate whether there
1894+
# is an existing DEFAULT constraint, instead of the actual DEFAULT constraint
1895+
# expression. In those cases, we do not want to explicitly include the DEFAULT
1896+
# constraint in the expression that is generated here.
1897+
if isinstance(server_default, bool):
1898+
server_default = None
18931899
return "%s %s %s%s%s" % (
18941900
alter_table(compiler, table_name, schema),
18951901
alter_column(compiler, column_name),

0 commit comments

Comments
 (0)