Skip to content

Commit 0d195c4

Browse files
authored
chore: Create a registry base class (#2756)
* chore: Create a registry base class Signed-off-by: Achal Shah <[email protected]> * abstract methods Signed-off-by: Achal Shah <[email protected]> * implement missing methods Signed-off-by: Achal Shah <[email protected]> * implement missing methods Signed-off-by: Achal Shah <[email protected]> * remove dupe Signed-off-by: Achal Shah <[email protected]>
1 parent b3fe39c commit 0d195c4

File tree

5 files changed

+468
-6
lines changed

5 files changed

+468
-6
lines changed

.github/workflows/pr_integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
SNOWFLAKE_CI_PASSWORD: ${{ secrets.SNOWFLAKE_CI_PASSWORD }}
171171
SNOWFLAKE_CI_ROLE: ${{ secrets.SNOWFLAKE_CI_ROLE }}
172172
SNOWFLAKE_CI_WAREHOUSE: ${{ secrets.SNOWFLAKE_CI_WAREHOUSE }}
173-
run: pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests --integration --durations=5
173+
run: pytest -n 8 --cov=./ --cov-report=xml --color=yes sdk/python/tests --integration --durations=5
174174
- name: Upload coverage to Codecov
175175
uses: codecov/codecov-action@v1
176176
with:

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
SNOWFLAKE_CI_PASSWORD: ${{ secrets.SNOWFLAKE_CI_PASSWORD }}
6767
SNOWFLAKE_CI_ROLE: ${{ secrets.SNOWFLAKE_CI_ROLE }}
6868
SNOWFLAKE_CI_WAREHOUSE: ${{ secrets.SNOWFLAKE_CI_WAREHOUSE }}
69-
run: FEAST_USAGE=False pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests
69+
run: FEAST_USAGE=False pytest -n 8 --cov=./ --cov-report=xml --color=yes sdk/python/tests
7070
- name: Upload coverage to Codecov
7171
uses: codecov/codecov-action@v1
7272
with:

sdk/python/feast/feature_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,8 @@ def _plan(
646646
self._registry.refresh()
647647
current_infra_proto = (
648648
self._registry.cached_registry_proto.infra.__deepcopy__()
649-
if self._registry.cached_registry_proto
649+
if hasattr(self._registry, "cached_registry_proto")
650+
and self._registry.cached_registry_proto
650651
else InfraProto()
651652
)
652653
desired_registry_proto = desired_repo_contents.to_registry_proto()

sdk/python/feast/infra/registry_stores/sql.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@
4848
from feast.protos.feast.core.ValidationProfile_pb2 import (
4949
ValidationReference as ValidationReferenceProto,
5050
)
51-
from feast.registry import Registry
51+
from feast.registry import BaseRegistry
5252
from feast.repo_config import RegistryConfig
5353
from feast.request_feature_view import RequestFeatureView
5454
from feast.saved_dataset import SavedDataset, ValidationReference
55+
from feast.stream_feature_view import StreamFeatureView
5556

5657
metadata = MetaData()
5758

@@ -121,7 +122,7 @@
121122
)
122123

123124

124-
class SqlRegistry(Registry):
125+
class SqlRegistry(BaseRegistry):
125126
def __init__(
126127
self, registry_config: Optional[RegistryConfig], repo_path: Optional[Path]
127128
):
@@ -152,6 +153,11 @@ def teardown(self):
152153
def refresh(self):
153154
pass
154155

156+
def list_stream_feature_views(
157+
self, project: str, allow_cache: bool = False
158+
) -> List[StreamFeatureView]:
159+
return []
160+
155161
def apply_entity(self, entity: Entity, project: str, commit: bool = True):
156162
return self._apply_object(entities, "entity_name", entity, "entity_proto")
157163

@@ -389,6 +395,22 @@ def apply_validation_reference(
389395
"validation_reference_proto",
390396
)
391397

398+
def apply_materialization(
399+
self,
400+
feature_view: FeatureView,
401+
project: str,
402+
start_date: datetime,
403+
end_date: datetime,
404+
commit: bool = True,
405+
):
406+
pass
407+
408+
def delete_validation_reference(self, name: str, project: str, commit: bool = True):
409+
pass
410+
411+
def commit(self):
412+
pass
413+
392414
def _apply_object(
393415
self, table, id_field_name, obj, proto_field_name,
394416
):

0 commit comments

Comments
 (0)