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

Remove sqeleton's runtime mixins (used only in tests) #709

Merged
merged 2 commits into from
Sep 28, 2023
Merged
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
5 changes: 0 additions & 5 deletions data_diff/sqeleton/databases/_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ def for_databases(self, *dbs) -> Self:
database_by_scheme = {k: db for k, db in self.database_by_scheme.items() if k in dbs}
return type(self)(database_by_scheme)

def load_mixins(self, *abstract_mixins: AbstractMixin) -> Self:
"Extend all the databases with a list of mixins that implement the given abstract mixins."
database_by_scheme = {k: db.load_mixins(*abstract_mixins) for k, db in self.database_by_scheme.items()}
return type(self)(database_by_scheme)

def connect_to_uri(self, db_uri: str, thread_count: Optional[int] = 1, **kwargs) -> Database:
"""Connect to the given database uri

Expand Down
8 changes: 0 additions & 8 deletions data_diff/sqeleton/databases/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,14 +551,6 @@ def list_tables(self, tables_like, schema=None):
def table(self, *path, **kw):
return bound_table(self, path, **kw)

@classmethod
def load_mixins(cls, *abstract_mixins) -> type:
class _DatabaseWithMixins(cls):
dialect = cls.dialect.load_mixins(*abstract_mixins)

_DatabaseWithMixins.__name__ = cls.__name__
return _DatabaseWithMixins


class ThreadedDatabase(Database):
"""Access the database through singleton threads.
Expand Down
Empty file removed tests/sqeleton/__init__.py
Empty file.
160 changes: 0 additions & 160 deletions tests/sqeleton/common.py

This file was deleted.

36 changes: 0 additions & 36 deletions tests/sqeleton/test_mixins.py

This file was deleted.

3 changes: 1 addition & 2 deletions tests/sqeleton/test_database.py → tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from data_diff.sqeleton import connect
from data_diff.sqeleton import databases as dbs
from data_diff.sqeleton.queries import table, current_timestamp, NormalizeAsString
from tests.common import TEST_MYSQL_CONN_STRING
from tests.sqeleton.common import str_to_checksum, test_each_database_in_list, get_conn, random_table_suffix
from tests.common import TEST_MYSQL_CONN_STRING, test_each_database_in_list, get_conn, str_to_checksum, random_table_suffix
from data_diff.sqeleton.abcs.database_types import TimestampTZ

TEST_DATABASES = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.