Skip to content

Commit

Permalink
chore: Update new contrib plugins to include usage (feast-dev#2638)
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Chiao <[email protected]>
  • Loading branch information
adchia authored May 4, 2022
1 parent 3eaf6b7 commit f22430a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from feast.repo_config import RepoConfig
from feast.saved_dataset import SavedDatasetStorage
from feast.type_map import pg_type_code_to_arrow
from feast.usage import log_exceptions_and_usage

from .postgres_source import PostgreSQLSource

Expand All @@ -50,6 +51,7 @@ class PostgreSQLOfflineStoreConfig(PostgreSQLConfig):

class PostgreSQLOfflineStore(OfflineStore):
@staticmethod
@log_exceptions_and_usage(offline_store="postgres")
def pull_latest_from_table_or_query(
config: RepoConfig,
data_source: DataSource,
Expand Down Expand Up @@ -100,6 +102,7 @@ def pull_latest_from_table_or_query(
)

@staticmethod
@log_exceptions_and_usage(offline_store="postgres")
def get_historical_features(
config: RepoConfig,
feature_views: List[FeatureView],
Expand Down Expand Up @@ -186,6 +189,7 @@ def query_generator() -> Iterator[str]:
)

@staticmethod
@log_exceptions_and_usage(offline_store="postgres")
def pull_all_from_table_or_query(
config: RepoConfig,
data_source: DataSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.repo_config import FeastConfigBaseModel, RepoConfig
from feast.usage import log_exceptions_and_usage


class HbaseOnlineStoreConfig(FeastConfigBaseModel):
Expand Down Expand Up @@ -78,6 +79,7 @@ def _get_conn(self, config: RepoConfig):
self._conn = Connection(host=store_config.host, port=int(store_config.port))
return self._conn

@log_exceptions_and_usage(online_store="hbase")
def online_write_batch(
self,
config: RepoConfig,
Expand Down Expand Up @@ -128,6 +130,7 @@ def online_write_batch(
b.put(row_key, values_dict)
b.send()

@log_exceptions_and_usage(online_store="hbase")
def online_read(
self,
config: RepoConfig,
Expand All @@ -142,6 +145,7 @@ def online_read(
config: The RepoConfig for the current FeatureStore.
table: Feast FeatureView.
entity_keys: a list of entity keys that should be read from the FeatureStore.
requested_features: a list of requested feature names.
"""
hbase = HbaseUtils(self._get_conn(config))
project = config.project
Expand Down Expand Up @@ -172,6 +176,7 @@ def online_read(
result.append((res_ts, res))
return result

@log_exceptions_and_usage(online_store="hbase")
def update(
self,
config: RepoConfig,
Expand Down
4 changes: 4 additions & 0 deletions sdk/python/feast/infra/online_stores/contrib/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.repo_config import RepoConfig
from feast.usage import log_exceptions_and_usage


class PostgreSQLOnlineStoreConfig(PostgreSQLConfig):
Expand All @@ -33,6 +34,7 @@ def _get_conn(self, config: RepoConfig):
self._conn = _get_conn(config.online_store)
return self._conn

@log_exceptions_and_usage(online_store="postgres")
def online_write_batch(
self,
config: RepoConfig,
Expand Down Expand Up @@ -86,6 +88,7 @@ def online_write_batch(
if progress:
progress(len(cur_batch))

@log_exceptions_and_usage(online_store="postgres")
def online_read(
self,
config: RepoConfig,
Expand Down Expand Up @@ -136,6 +139,7 @@ def online_read(

return result

@log_exceptions_and_usage(online_store="postgres")
def update(
self,
config: RepoConfig,
Expand Down

0 comments on commit f22430a

Please sign in to comment.