Skip to content

Commit

Permalink
Attempt to fix metrica tests (#128)
Browse files Browse the repository at this point in the history
* Attempt to fix metrica tests

* Fix

---------

Co-authored-by: Valeria Bulanova <[email protected]>
  • Loading branch information
vallbull and vallbull authored Nov 30, 2023
1 parent 1cfcd9d commit 5836008
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/dl_core/dl_core/data_source/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5836008

Please sign in to comment.