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

Add assertions for supported sources for known online stores #1648

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/online_stores/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_online_store_from_config(


SUPPORTED_SOURCES: Dict[Any, Set[Any]] = {
SqliteOnlineStoreConfig: {FileSource},
SqliteOnlineStoreConfig: {FileSource, BigQuerySource},
DatastoreOnlineStoreConfig: {BigQuerySource},
RedisOnlineStoreConfig: {FileSource, BigQuerySource},
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _validate_offline_store_config(cls, values):

# Set the default type
if "type" not in values["offline_store"]:
if values["provider"] == "local" or values["provider"] == "redis":
if values["provider"] == "local":
values["offline_store"]["type"] = "file"
elif values["provider"] == "gcp":
values["offline_store"]["type"] = "bigquery"
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from feast.feature_view import FeatureView
from feast.inference import infer_entity_value_type_from_feature_views
from feast.infra.offline_stores.helpers import assert_offline_store_supports_data_source
from feast.infra.online_stores.helpers import assert_online_store_supports_data_source
from feast.infra.provider import get_provider
from feast.names import adjectives, animals
from feast.registry import Registry
Expand Down Expand Up @@ -155,6 +156,7 @@ def apply_total(repo_config: RepoConfig, repo_path: Path):
assert_offline_store_supports_data_source(
repo_config.offline_store, data_source
)
assert_online_store_supports_data_source(repo_config.online_store, data_source)

tables_to_delete = []
for registry_table in registry.list_feature_tables(project=project):
Expand All @@ -177,7 +179,7 @@ def apply_total(repo_config: RepoConfig, repo_path: Path):
for table in repo.feature_tables:
registry.apply_feature_table(table, project)
click.echo(
f"Registered feature table {Style.BRIGHT + Fore.GREEN}{registry_table.name}{Style.RESET_ALL}"
f"Registered feature table {Style.BRIGHT + Fore.GREEN}{table.name}{Style.RESET_ALL}"
)

# Delete views that should not exist
Expand Down