Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix metrica tests #128

Merged
merged 2 commits into from
Nov 30, 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
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 @@ -348,7 +348,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
Loading