Skip to content

test: fix numeric compliance test #29

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

Merged
merged 20 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions google/cloud/sqlalchemy_spanner/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ def get_isolation_levels(self, _):
dict: isolation levels description.
"""
return {"default": "SERIALIZABLE", "supported": ["SERIALIZABLE", "AUTOCOMMIT"]}

@property
def precision_numerics_enotation_large(self):
"""target backend supports Decimal() objects using E notation
to represent very large values."""
return exclusions.open()
7 changes: 4 additions & 3 deletions google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,6 @@ def visit_large_binary(self, type_, **kw):
def visit_DECIMAL(self, type_, **kw):
return "NUMERIC"

def visit_NUMERIC(self, type_, **kw):
return "NUMERIC"

def visit_VARCHAR(self, type_, **kw):
return "STRING({})".format(type_.length or "MAX")

Expand All @@ -276,6 +273,9 @@ def visit_BOOLEAN(self, type_, **kw):
def visit_DATETIME(self, type_, **kw):
return "TIMESTAMP"

def visit_NUMERIC(self, type_, **kw):
return "NUMERIC"

def visit_BIGINT(self, type_, **kw):
return "INT64"

Expand All @@ -302,6 +302,7 @@ class SpannerDialect(DefaultDialect):
supports_sequences = True
supports_native_enum = True
supports_native_boolean = True
supports_native_decimal = True

ddl_compiler = SpannerDDLCompiler
preparer = SpannerIdentifierPreparer
Expand Down
Loading