Skip to content
Merged
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
Next Next commit
updated
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
  • Loading branch information
franciscojavierarceo committed Jun 5, 2024
commit 86ec8b74785abbdcdca0a5c724b8b1ad042faa0e
47 changes: 22 additions & 25 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,16 @@ def list_feature_views(self, allow_cache: bool = False) -> List[FeatureView]:
"""
return self._list_batch_feature_views(allow_cache)


def _list_feature_views(
self,
allow_cache: bool = False,
hide_dummy_entity: bool = True,
self,
allow_cache: bool = False,
hide_dummy_entity: bool = True,
) -> List[FeatureView]:
return self._list_batch_feature_views(allow_cache)


def list_all_feature_views(self, allow_cache: bool = False) -> List[FeatureView]:
def list_all_feature_views(
self, allow_cache: bool = False
) -> List[Union[FeatureView, StreamFeatureView, OnDemandFeatureView]]:
"""
Retrieves the list of feature views from the registry.

Expand All @@ -280,7 +280,6 @@ def list_all_feature_views(self, allow_cache: bool = False) -> List[FeatureView]
"""
return self._list_all_feature_views(allow_cache)


def list_batch_feature_views(self, allow_cache: bool = False) -> List[FeatureView]:
"""
Retrieves the list of batch feature views from the registry.
Expand All @@ -294,26 +293,24 @@ def list_batch_feature_views(self, allow_cache: bool = False) -> List[FeatureVie
return self._list_batch_feature_views(allow_cache)

def _list_batch_feature_views(
self,
allow_cache: bool = False,
hide_dummy_entity: bool = True,
self,
allow_cache: bool = False,
hide_dummy_entity: bool = True,
) -> List[FeatureView]:
feature_views = []
for fv in self._registry.list_feature_views(
self.project, allow_cache=allow_cache
self.project, allow_cache=allow_cache
):
if (
hide_dummy_entity
and fv.entities
and fv.entities[0] == DUMMY_ENTITY_NAME
hide_dummy_entity
and fv.entities
and fv.entities[0] == DUMMY_ENTITY_NAME
):
fv.entities = []
fv.entity_columns = []
feature_views.append(fv)
return feature_views



def _list_stream_feature_views(
self,
allow_cache: bool = False,
Expand Down Expand Up @@ -353,22 +350,22 @@ def list_stream_feature_views(
"""
return self._list_stream_feature_views(allow_cache)


def _list_all_feature_views(
self,
allow_cache: bool = False,
hide_dummy_entity: bool = True,
) -> List[FeatureView]:
self,
allow_cache: bool = False,
hide_dummy_entity: bool = True,
) -> List[Union[FeatureView, StreamFeatureView, OnDemandFeatureView]]:
"""
Retrieves the list of all feature views from the registry.

Returns:
A list of all feature views.
"""
return self._list_batch_feature_views(allow_cache, hide_dummy_entity) + \
self._list_stream_feature_views(allow_cache, hide_dummy_entity) + \
self.list_on_demand_feature_views(allow_cache)

return (
self._list_batch_feature_views(allow_cache, hide_dummy_entity)
+ self._list_stream_feature_views(allow_cache, hide_dummy_entity)
+ self.list_on_demand_feature_views(allow_cache)
)

def list_data_sources(self, allow_cache: bool = False) -> List[DataSource]:
"""
Expand Down