8000 refactor!: erase dbapi directory and all the related tests (#554) · FirePing32/python-spanner-django@8183247 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8183247

Browse files
author
Ilya Gurov
authored
refactor!: erase dbapi directory and all the related tests (googleapis#554)
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.
1 parent 5910833 commit 8183247

28 files changed

+13
-4355
lines changed

.github/workflows/system-tests-against-emulator.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

django_spanner/compiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
SQLInsertCompiler as BaseSQLInsertCompiler,
1313
SQLUpdateCompiler as BaseSQLUpdateCompiler,
1414
)
15-
from django.db.utils import DatabaseError, add_dummy_where
15+
from django.db.utils import DatabaseError
16+
from django_spanner.utils import add_dummy_where
1617

1718

1819
class SQLCompiler(BaseSQLCompiler):

django_spanner/introspection.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
TableInfo,
1111
)
1212
from django.db.models import Index
13-
from google.cloud.spanner_v1.proto import type_pb2
13+
from google.cloud.spanner_v1 import TypeCode
1414

1515

1616
class DatabaseIntrospection(BaseDatabaseIntrospection):
1717
data_types_reverse = {
18-
type_pb2.BOOL: "BooleanField",
19-
type_pb2.BYTES: "BinaryField",
20-
type_pb2.DATE: "DateField",
21-
type_pb2.FLOAT64: "FloatField",
22-
type_pb2.INT64: "IntegerField",
23-
type_pb2.STRING: "CharField",
24-
type_pb2.TIMESTAMP: "DateTimeField",
18+
TypeCode.BOOL: "BooleanField",
19+
TypeCode.BYTES: "BinaryField",
20+
TypeCode.DATE: "DateField",
21+
TypeCode.FLOAT64: "FloatField",
22+
TypeCode.INT64: "IntegerField",
23+
TypeCode.STRING: "CharField",
24+
TypeCode.TIMESTAMP: "DateTimeField",
2525
}
2626

2727
def get_field_type(self, data_type, description):
28-
if data_type == type_pb2.STRING and description.internal_size == "MAX":
28+
if data_type == TypeCode.STRING and description.internal_size == "MAX":
2929
return "TextField"
3030
return super().get_field_type(data_type, description)
3131

google/__init__.py

Whitespace-only changes.

google/cloud/__init__.py

Whitespace-only changes.

google/cloud/spanner_dbapi/__init__.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

google/cloud/spanner_dbapi/_helpers.py

Lines changed: 0 additions & 159 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0