From 583600883c7cb994cc34d1fa7177e26b3aae0152 Mon Sep 17 00:00:00 2001 From: vallbull <33630435+vallbull@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:02:46 +0300 Subject: [PATCH] Attempt to fix metrica tests (#128) * Attempt to fix metrica tests * Fix --------- Co-authored-by: Valeria Bulanova --- .../ext/core/test_dataset.py | 25 ++++++++++++++++++- lib/dl_core/dl_core/data_source/sql.py | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/dl_connector_metrica/dl_connector_metrica_tests/ext/core/test_dataset.py b/lib/dl_connector_metrica/dl_connector_metrica_tests/ext/core/test_dataset.py index e4bb24b4b..5f472babd 100644 --- a/lib/dl_connector_metrica/dl_connector_metrica_tests/ext/core/test_dataset.py +++ b/lib/dl_connector_metrica/dl_connector_metrica_tests/ext/core/test_dataset.py @@ -1,10 +1,15 @@ -from typing import Optional +from typing import ( + AbstractSet, + Optional, +) import pytest import sqlalchemy as sa from dl_constants.enums import ( DataSourceRole, + DataSourceType, + JoinType, UserDataType, ) from dl_core.dataset_capabilities import DatasetCapabilities @@ -232,6 +237,15 @@ def test_source_cannot_be_added( finally: sync_us_manager.delete(testing_conn) + def _check_supported_join_types(self, supp_join_types: AbstractSet[JoinType]) -> None: + assert not supp_join_types + + def _check_compatible_source_types(self, compat_source_types: AbstractSet[DataSourceType]) -> None: + assert not compat_source_types + + def _allow_adding_sources(self, dataset: Dataset) -> bool: + return False + class TestAppMetricaDataset(BaseAppMetricaTestClass, DefaultDatasetTestSuite[AppMetricaApiConnection]): source_type = SOURCE_TYPE_APPMETRICA_API @@ -245,6 +259,15 @@ class TestAppMetricaDataset(BaseAppMetricaTestClass, DefaultDatasetTestSuite[App }, ) + def _check_supported_join_types(self, supp_join_types: AbstractSet[JoinType]) -> None: + assert not supp_join_types + + def _check_compatible_source_types(self, compat_source_types: AbstractSet[DataSourceType]) -> None: + assert not compat_source_types + + def _allow_adding_sources(self, dataset: Dataset) -> bool: + return False + @pytest.fixture(scope="function") def dsrc_params(self) -> dict: return dict( diff --git a/lib/dl_core/dl_core/data_source/sql.py b/lib/dl_core/dl_core/data_source/sql.py index 9936c27d0..bc119222c 100644 --- a/lib/dl_core/dl_core/data_source/sql.py +++ b/lib/dl_core/dl_core/data_source/sql.py @@ -349,7 +349,7 @@ def get_parameters(self) -> dict: ) -class PseudoSQLDataSource(StandardSQLDataSource, IncompatibleDataSourceMixin): +class PseudoSQLDataSource(IncompatibleDataSourceMixin, StandardSQLDataSource): supported_join_types: ClassVar[frozenset[JoinType]] = frozenset() supports_schema_update: ClassVar[bool] = False