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

feat: Lazy Infra Creation with online_store Option Set to True #144

Merged
merged 15 commits into from
Oct 22, 2024
19 changes: 11 additions & 8 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,14 +991,15 @@ def apply(
)
tables_to_keep: List[FeatureView] = views_to_update + sfvs_to_update # type: ignore

self._get_provider().update_infra(
project=self.project,
tables_to_delete=tables_to_delete,
tables_to_keep=tables_to_keep,
entities_to_delete=entities_to_delete if not partial else [],
entities_to_keep=entities_to_update,
partial=partial,
)
if not getattr(self.config.online_store, "lazy_table_creation", False):
self._get_provider().update_infra(
project=self.project,
tables_to_delete=tables_to_delete,
tables_to_keep=tables_to_keep,
entities_to_delete=entities_to_delete if not partial else [],
entities_to_keep=entities_to_update,
partial=partial,
)

self._registry.commit()

Expand Down Expand Up @@ -1255,6 +1256,7 @@ def materialize_incremental(
feature_views_to_materialize = self._get_feature_views_to_materialize(
feature_views
)

zabarn marked this conversation as resolved.
Show resolved Hide resolved
_print_materialization_log(
None,
end_date,
Expand Down Expand Up @@ -1350,6 +1352,7 @@ def materialize(
feature_views_to_materialize = self._get_feature_views_to_materialize(
feature_views
)

_print_materialization_log(
start_date,
end_date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class CassandraOnlineStoreConfig(FeastConfigBaseModel):
and password being the Client ID and Client Secret of the database token.
"""

type: Literal["cassandra"] = "cassandra"
type: Literal["cassandra", "scylladb"] = "cassandra"
"""Online store type selector."""

# settings for connection to Cassandra / Astra DB
Expand Down Expand Up @@ -153,6 +153,12 @@ class CassandraOnlineStoreConfig(FeastConfigBaseModel):
request_timeout: Optional[StrictFloat] = None
"""Request timeout in seconds."""

lazy_table_creation: Optional[bool] = False
"""
If True, tables will be created on during materialization, rather than registration.
Table deletion is not currently supported in this mode.
"""

class CassandraLoadBalancingPolicy(FeastConfigBaseModel):
"""
Configuration block related to the Cluster's load-balancing policy.
Expand Down
1 change: 1 addition & 0 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"postgres": "feast.infra.online_stores.contrib.postgres.PostgreSQLOnlineStore",
"hbase": "feast.infra.online_stores.contrib.hbase_online_store.hbase.HbaseOnlineStore",
"cassandra": "feast.infra.online_stores.contrib.cassandra_online_store.cassandra_online_store.CassandraOnlineStore",
"scylladb": "feast.infra.online_stores.contrib.cassandra_online_store.cassandra_online_store.CassandraOnlineStore",
"mysql": "feast.infra.online_stores.contrib.mysql_online_store.mysql.MySQLOnlineStore",
"hazelcast": "feast.infra.online_stores.contrib.hazelcast_online_store.hazelcast_online_store.HazelcastOnlineStore",
"milvus": "feast.expediagroup.vectordb.milvus_online_store.MilvusOnlineStore",
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@

GE_REQUIRED = ["great_expectations>=0.15.41"]

SCYLLADB_REQUIRED = [
"scylla-driver>=3.24.0,<4",
]

AZURE_REQUIRED = [
"azure-storage-blob>=0.37.0",
"azure-identity>=1.6.1",
Expand Down Expand Up @@ -477,6 +481,7 @@ def run(self):
"hbase": HBASE_REQUIRED,
"docs": DOCS_REQUIRED,
"cassandra": CASSANDRA_REQUIRED,
"scylladb": SCYLLADB_REQUIRED,
"hazelcast": HAZELCAST_REQUIRED,
"grpcio": GRPCIO_REQUIRED,
"ibis": IBIS_REQUIRED,
Expand Down
Loading