Visitar URL original
fix: Allow serving features while a feature view is MATERIALIZING by alan-gauthier-jt · Pull Request #6789 · feast-dev/feast · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix: Honor serve_features_while_materializing on all registry backends
Default the flag on BaseRegistry and wire it in RemoteRegistry and SnowflakeRegistry.

Signed-off-by: Alan Gauthier <alan.gauthier@jobteaser.com>
  • Loading branch information
alan-gauthier-jt authored and ntkathole committed Sep 29, 2026
commit b696c79c522fd03ca0085384db7545124ff2205c
5 changes: 5 additions & 0 deletions sdk/python/feast/infra/registry/base_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class BaseRegistry(ABC):
feature views, and data sources).
"""

# Opt-in: keep serving a feature view's last-materialized values while it is
# MATERIALIZING. Registries built from a RegistryConfig set it from
# ``registry_config.serve_features_while_materializing``.
serve_features_while_materializing: bool = False

# Entity operations
@abstractmethod
def apply_entity(self, entity: Entity, project: str, commit: bool = True):
Expand Down
3 changes: 3 additions & 0 deletions sdk/python/feast/infra/registry/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def __init__(
):
self.auth_config = auth_config
assert isinstance(registry_config, RemoteRegistryConfig)
self.serve_features_while_materializing = (
registry_config.serve_features_while_materializing
)
self.channel = self._create_grpc_channel(registry_config)
weakref.finalize(self, self.channel.close)

Expand Down
3 changes: 3 additions & 0 deletions sdk/python/feast/infra/registry/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def __init__(
execute_snowflake_statement(conn, query)

self.purge_feast_metadata = registry_config.purge_feast_metadata
self.serve_features_while_materializing = (
registry_config.serve_features_while_materializing
)
self.project = project

# Initialize cache state before any method that may trigger
Expand Down
22 changes: 22 additions & 0 deletions sdk/python/tests/unit/test_feature_view_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,3 +481,25 @@ def test_created_still_blocked_even_with_flag(self):
)
with pytest.raises(ValueError, match="cannot serve features"):
utils._get_feature_views_to_use(registry, "default", ["test_fv:f1"])


class TestServeWhileMaterializingRegistryPropagation:
def test_base_registry_defaults_to_false(self):
from feast.infra.registry.base_registry import BaseRegistry

assert BaseRegistry.serve_features_while_materializing is False

@pytest.mark.parametrize("enabled", [True, False])
def test_remote_registry_reads_flag_from_config(self, enabled):
from feast.infra.registry.remote import RemoteRegistry, RemoteRegistryConfig

config = RemoteRegistryConfig(
registry_type="remote",
path="localhost:6570",
serve_features_while_materializing=enabled,
)
registry = RemoteRegistry(config, project="test", repo_path=None)
try:
assert registry.serve_features_while_materializing is enabled
finally:
registry.close()
Loading