Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Prevent type overflow #757

Merged
merged 8 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: fix unit tests
  • Loading branch information
pik94 committed Nov 14, 2023
commit 98e847bc611f178d2a6ff3c3212f7e16e1540f61
2 changes: 1 addition & 1 deletion data_diff/databases/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def import_mssql():
class Dialect(BaseDialect):
name = "MsSQL"
ROUNDS_ON_PREC_LOSS = True
SUPPORTS_PRIMARY_KEY = True
SUPPORTS_PRIMARY_KEY: ClassVar[bool] = True
SUPPORTS_INDEXES = True
TYPE_CLASSES = {
# Timestamps
Expand Down
2 changes: 1 addition & 1 deletion data_diff/databases/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def import_mysql():
class Dialect(BaseDialect):
name = "MySQL"
ROUNDS_ON_PREC_LOSS = True
SUPPORTS_PRIMARY_KEY = True
SUPPORTS_PRIMARY_KEY: ClassVar[bool] = True
SUPPORTS_INDEXES = True
TYPE_CLASSES = {
# Dates
Expand Down
2 changes: 1 addition & 1 deletion data_diff/databases/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Dialect(
BaseDialect,
):
name = "Oracle"
SUPPORTS_PRIMARY_KEY = True
SUPPORTS_PRIMARY_KEY: ClassVar[bool] = True
SUPPORTS_INDEXES = True
TYPE_CLASSES: Dict[str, type] = {
"NUMBER": Decimal,
Expand Down
2 changes: 1 addition & 1 deletion data_diff/databases/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def import_postgresql():
class PostgresqlDialect(BaseDialect):
name = "PostgreSQL"
ROUNDS_ON_PREC_LOSS = True
SUPPORTS_PRIMARY_KEY = True
SUPPORTS_PRIMARY_KEY: ClassVar[bool] = True
SUPPORTS_INDEXES = True

TYPE_CLASSES: ClassVar[Dict[str, Type[ColType]]] = {
Expand Down
4 changes: 3 additions & 1 deletion tests/test_joindiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ def test_null_pks(self):
self.assertRaises(ValueError, list, x)


@test_each_database_in_list(d for d in TEST_DATABASES if d.dialect.SUPPORTS_PRIMARY_KEY and d.SUPPORTS_UNIQUE_CONSTAINT)
@test_each_database_in_list(
d for d in TEST_DATABASES if d.DIALECT_CLASS.SUPPORTS_PRIMARY_KEY and d.SUPPORTS_UNIQUE_CONSTAINT
)
class TestUniqueConstraint(DiffTestCase):
def setUp(self):
super().setUp()
Expand Down