Skip to content

Commit f22430a

Browse files
authored
chore: Update new contrib plugins to include usage (#2638)
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 3eaf6b7 commit f22430a

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from feast.repo_config import RepoConfig
4141
from feast.saved_dataset import SavedDatasetStorage
4242
from feast.type_map import pg_type_code_to_arrow
43+
from feast.usage import log_exceptions_and_usage
4344

4445
from .postgres_source import PostgreSQLSource
4546

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

5152
class PostgreSQLOfflineStore(OfflineStore):
5253
@staticmethod
54+
@log_exceptions_and_usage(offline_store="postgres")
5355
def pull_latest_from_table_or_query(
5456
config: RepoConfig,
5557
data_source: DataSource,
@@ -100,6 +102,7 @@ def pull_latest_from_table_or_query(
100102
)
101103

102104
@staticmethod
105+
@log_exceptions_and_usage(offline_store="postgres")
103106
def get_historical_features(
104107
config: RepoConfig,
105108
feature_views: List[FeatureView],
@@ -186,6 +189,7 @@ def query_generator() -> Iterator[str]:
186189
)
187190

188191
@staticmethod
192+
@log_exceptions_and_usage(offline_store="postgres")
189193
def pull_all_from_table_or_query(
190194
config: RepoConfig,
191195
data_source: DataSource,

sdk/python/feast/infra/online_stores/contrib/hbase_online_store/hbase.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
1515
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
1616
from feast.repo_config import FeastConfigBaseModel, RepoConfig
17+
from feast.usage import log_exceptions_and_usage
1718

1819

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

82+
@log_exceptions_and_usage(online_store="hbase")
8183
def online_write_batch(
8284
self,
8385
config: RepoConfig,
@@ -128,6 +130,7 @@ def online_write_batch(
128130
b.put(row_key, values_dict)
129131
b.send()
130132

133+
@log_exceptions_and_usage(online_store="hbase")
131134
def online_read(
132135
self,
133136
config: RepoConfig,
@@ -142,6 +145,7 @@ def online_read(
142145
config: The RepoConfig for the current FeatureStore.
143146
table: Feast FeatureView.
144147
entity_keys: a list of entity keys that should be read from the FeatureStore.
148+
requested_features: a list of requested feature names.
145149
"""
146150
hbase = HbaseUtils(self._get_conn(config))
147151
project = config.project
@@ -172,6 +176,7 @@ def online_read(
172176
result.append((res_ts, res))
173177
return result
174178

179+
@log_exceptions_and_usage(online_store="hbase")
175180
def update(
176181
self,
177182
config: RepoConfig,

sdk/python/feast/infra/online_stores/contrib/postgres.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
1919
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
2020
from feast.repo_config import RepoConfig
21+
from feast.usage import log_exceptions_and_usage
2122

2223

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

37+
@log_exceptions_and_usage(online_store="postgres")
3638
def online_write_batch(
3739
self,
3840
config: RepoConfig,
@@ -86,6 +88,7 @@ def online_write_batch(
8688
if progress:
8789
progress(len(cur_batch))
8890

91+
@log_exceptions_and_usage(online_store="postgres")
8992
def online_read(
9093
self,
9194
config: RepoConfig,
@@ -136,6 +139,7 @@ def online_read(
136139

137140
return result
138141

142+
@log_exceptions_and_usage(online_store="postgres")
139143
def update(
140144
self,
141145
config: RepoConfig,

0 commit comments

Comments
 (0)