Skip to content

Commit

Permalink
feat: Enable Infra Creation During Materialization (#147)
Browse files Browse the repository at this point in the history
* test changes

* fix: allow for scylladb in feature_store.yaml

* fix: linter issue

* fix: linter issue

* fix materialization/registration logic

* fix: use kwargs in expedia provider update infra

* try to ignore keyword lint error

* allow for non-lazy table creation

* fix: lint formatting

* dont update for non-scylladb

* fix: lint formatting

* fix: address Bhargav's comments

* feat: enable infra creation during materialization

* fix: use logger instead of print

* fix: remove else clause
  • Loading branch information
zabarn authored Oct 22, 2024
1 parent 1326610 commit 8e0fa7c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sdk/python/feast/infra/passthrough_provider.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from datetime import datetime, timedelta
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union

Expand Down Expand Up @@ -37,6 +38,8 @@
make_tzaware,
)

logger = logging.getLogger(__name__)

DEFAULT_BATCH_SIZE = 10_000


Expand Down Expand Up @@ -317,6 +320,21 @@ def materialize_single_feature_view(
or isinstance(feature_view, StreamFeatureView)
or isinstance(feature_view, FeatureView)
), f"Unexpected type for {feature_view.name}: {type(feature_view)}"

if getattr(config.online_store, "lazy_table_creation", False):
logger.info(
f"Online store {config.online_store.__class__.__name__} supports lazy table creation and it is enabled"
)

self.update_infra(
project=project,
tables_to_delete=[],
tables_to_keep=[feature_view],
entities_to_delete=[],
entities_to_keep=registry.list_entities(project=project),
partial=True,
)

task = MaterializationTask(
project=project,
feature_view=feature_view,
Expand Down

0 comments on commit 8e0fa7c

Please sign in to comment.