Skip to content

Commit

Permalink
refactor!: erase dbapi directory and all the related tests (#554)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: DBAPI code was moved into python-spanner in
googleapis/python-spanner#160. This change removes it
from this repo and bumps the dependency on python-spanner to 2.0.0, the first
released version to include DBAPI.
  • Loading branch information
Ilya Gurov committed Nov 25, 2020
1 parent 5910833 commit 8183247
Show file tree
Hide file tree
Showing 28 changed files with 13 additions and 4,355 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/system-tests-against-emulator.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion django_spanner/compiler.py
Expand Up @@ -12,7 +12,8 @@
SQLInsertCompiler as BaseSQLInsertCompiler,
SQLUpdateCompiler as BaseSQLUpdateCompiler,
)
from django.db.utils import DatabaseError, add_dummy_where
from django.db.utils import DatabaseError
from django_spanner.utils import add_dummy_where


class SQLCompiler(BaseSQLCompiler):
Expand Down
18 changes: 9 additions & 9 deletions django_spanner/introspection.py
Expand Up @@ -10,22 +10,22 @@
TableInfo,
)
from django.db.models import Index
from google.cloud.spanner_v1.proto import type_pb2
from google.cloud.spanner_v1 import TypeCode


class DatabaseIntrospection(BaseDatabaseIntrospection):
data_types_reverse = {
type_pb2.BOOL: "BooleanField",
type_pb2.BYTES: "BinaryField",
type_pb2.DATE: "DateField",
type_pb2.FLOAT64: "FloatField",
type_pb2.INT64: "IntegerField",
type_pb2.STRING: "CharField",
type_pb2.TIMESTAMP: "DateTimeField",
TypeCode.BOOL: "BooleanField",
TypeCode.BYTES: "BinaryField",
TypeCode.DATE: "DateField",
TypeCode.FLOAT64: "FloatField",
TypeCode.INT64: "IntegerField",
TypeCode.STRING: "CharField",
TypeCode.TIMESTAMP: "DateTimeField",
}

def get_field_type(self, data_type, description):
if data_type == type_pb2.STRING and description.internal_size == "MAX":
if data_type == TypeCode.STRING and description.internal_size == "MAX":
return "TextField"
return super().get_field_type(data_type, description)

Expand Down
Empty file removed google/__init__.py
Empty file.
Empty file removed google/cloud/__init__.py
Empty file.
85 changes: 0 additions & 85 deletions google/cloud/spanner_dbapi/__init__.py

This file was deleted.

159 changes: 0 additions & 159 deletions google/cloud/spanner_dbapi/_helpers.py

This file was deleted.

0 comments on commit 8183247

Please sign in to comment.