Skip to content

Commit

Permalink
chore: Backward compatibility for test repo configurations (#2671)
Browse files Browse the repository at this point in the history
* backward compatibility for all test repo configurations

Signed-off-by: Oleksii Moskalenko <[email protected]>

* format

Signed-off-by: Oleksii Moskalenko <[email protected]>

* fix arguments order

Signed-off-by: Oleksii Moskalenko <[email protected]>
  • Loading branch information
pyalex authored May 12, 2022
1 parent 0cbc5f2 commit 32c38aa
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions sdk/python/tests/integration/feature_repos/repo_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,37 @@
if full_repo_configs_module is not None:
try:
module = importlib.import_module(full_repo_configs_module)
AVAILABLE_ONLINE_STORES = getattr(module, "AVAILABLE_ONLINE_STORES")
AVAILABLE_OFFLINE_STORES = getattr(module, "AVAILABLE_OFFLINE_STORES")
except Exception as e:
except ImportError as e:
raise FeastModuleImportError(
"FULL_REPO_CONFIGS", full_repo_configs_module
full_repo_configs_module, "FULL_REPO_CONFIGS"
) from e

try:
AVAILABLE_ONLINE_STORES = getattr(module, "AVAILABLE_ONLINE_STORES")
AVAILABLE_OFFLINE_STORES = getattr(module, "AVAILABLE_OFFLINE_STORES")
except AttributeError:
try:
FULL_REPO_CONFIGS: List[IntegrationTestRepoConfig] = getattr(
module, "FULL_REPO_CONFIGS"
)
except AttributeError as e:
raise FeastModuleImportError(
full_repo_configs_module, "FULL_REPO_CONFIGS"
) from e

AVAILABLE_OFFLINE_STORES = [
(config.provider, config.offline_store_creator)
for config in FULL_REPO_CONFIGS
]
AVAILABLE_OFFLINE_STORES = list(set(AVAILABLE_OFFLINE_STORES)) # unique only

AVAILABLE_ONLINE_STORES = {
c.online_store["type"]
if isinstance(c.online_store, dict)
else c.online_store: (c.online_store, c.online_store_creator)
for c in FULL_REPO_CONFIGS
}


if os.getenv("FEAST_LOCAL_ONLINE_CONTAINER", "False").lower() == "true":
replacements: Dict[
Expand Down

0 comments on commit 32c38aa

Please sign in to comment.