Skip to content

test: native enums #698

New issue

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ class SpannerDialect(DefaultDialect):
supports_sequences = True
sequences_optional = False
supports_identity_columns = True
supports_native_enum = True
supports_native_enum = False
supports_native_boolean = True
supports_native_decimal = True
supports_statement_cache = True
Expand Down
5 changes: 4 additions & 1 deletion test/mockserver_tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
func,
text,
BigInteger,
Enum,
)
from sqlalchemy.orm import Session, DeclarativeBase, Mapped, mapped_column
from sqlalchemy.testing import eq_, is_instance_of
Expand Down Expand Up @@ -120,6 +121,7 @@ def test_create_table(self):
metadata,
Column("user_id", Integer, primary_key=True),
Column("user_name", String(16), nullable=False),
Column("status", Enum("pending_activation", "active", "disabled")),
)
metadata.create_all(engine)
requests = self.database_admin_service.requests
Expand All @@ -130,7 +132,8 @@ def test_create_table(self):
"CREATE TABLE users (\n"
"\tuser_id INT64 NOT NULL "
"GENERATED BY DEFAULT AS IDENTITY (BIT_REVERSED_POSITIVE), \n"
"\tuser_name STRING(16) NOT NULL\n"
"\tuser_name STRING(16) NOT NULL, \n"
"\tstatus STRING(18)\n"
") PRIMARY KEY (user_id)",
requests[0].statements[0],
)
Expand Down