Skip to content

Commit

Permalink
Move IntegrationTestRepoConfig class to another module (#1962)
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 authored Oct 22, 2021
1 parent 3b5ea8f commit b0635c3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from dataclasses import dataclass
from typing import Dict, Type, Union

from tests.integration.feature_repos.universal.data_source_creator import (
DataSourceCreator,
)
from tests.integration.feature_repos.universal.data_sources.file import (
FileDataSourceCreator,
)


@dataclass(frozen=True)
class IntegrationTestRepoConfig:
"""
This class should hold all possible parameters that may need to be varied by individual tests.
"""

provider: str = "local"
online_store: Union[str, Dict] = "sqlite"

offline_store_creator: Type[DataSourceCreator] = FileDataSourceCreator

full_feature_names: bool = True
infer_features: bool = False

def __repr__(self) -> str:
return "-".join(
[
f"Provider: {self.provider}",
f"{self.offline_store_creator.__name__.split('.')[-1].rstrip('DataSourceCreator')}",
self.online_store
if isinstance(self.online_store, str)
else self.online_store["type"],
]
)
35 changes: 4 additions & 31 deletions sdk/python/tests/integration/feature_repos/repo_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
from dataclasses import dataclass, field
from datetime import datetime, timedelta
from pathlib import Path
from typing import Any, Dict, List, Optional, Type, Union
from typing import Any, Dict, List, Optional

import pandas as pd

from feast import FeatureStore, FeatureView, RepoConfig, driver_test_data
from feast.constants import FULL_REPO_CONFIGS_MODULE_ENV_NAME
from feast.data_source import DataSource
from tests.integration.feature_repos.integration_test_repo_config import (
IntegrationTestRepoConfig,
)
from tests.integration.feature_repos.universal.data_source_creator import (
DataSourceCreator,
)
from tests.integration.feature_repos.universal.data_sources.bigquery import (
BigQueryDataSourceCreator,
)
from tests.integration.feature_repos.universal.data_sources.file import (
FileDataSourceCreator,
)
from tests.integration.feature_repos.universal.data_sources.redshift import (
RedshiftDataSourceCreator,
)
Expand All @@ -36,33 +36,6 @@
create_order_feature_view,
)


@dataclass(frozen=True)
class IntegrationTestRepoConfig:
"""
This class should hold all possible parameters that may need to be varied by individual tests.
"""

provider: str = "local"
online_store: Union[str, Dict] = "sqlite"

offline_store_creator: Type[DataSourceCreator] = FileDataSourceCreator

full_feature_names: bool = True
infer_features: bool = False

def __repr__(self) -> str:
return "-".join(
[
f"Provider: {self.provider}",
f"{self.offline_store_creator.__name__.split('.')[-1].rstrip('DataSourceCreator')}",
self.online_store
if isinstance(self.online_store, str)
else self.online_store["type"],
]
)


DYNAMO_CONFIG = {"type": "dynamodb", "region": "us-west-2"}
REDIS_CONFIG = {"type": "redis", "connection_string": "localhost:6379,db=0"}

Expand Down

0 comments on commit b0635c3

Please sign in to comment.