Skip to content

Commit ce94804

Browse files
chore: Update online store docstrings (#3066)
* Update online store docstrings Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Shorten Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Redis docstring Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Add links for data model Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Fix Redis docstring Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Fix Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Add note Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Format Signed-off-by: Felix Wang <wangfelix98@gmail.com> * Fix Signed-off-by: Felix Wang <wangfelix98@gmail.com> Signed-off-by: Felix Wang <wangfelix98@gmail.com>
1 parent f0874da commit ce94804

File tree

5 files changed

+65
-31
lines changed

5 files changed

+65
-31
lines changed

sdk/python/feast/infra/online_stores/datastore.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ class DatastoreOnlineStoreConfig(FeastConfigBaseModel):
8080

8181
class DatastoreOnlineStore(OnlineStore):
8282
"""
83-
OnlineStore is an object used for all interaction between Feast and the service used for offline storage of
84-
features.
83+
Google Cloud Datastore implementation of the online store interface.
84+
85+
See https://github.com/feast-dev/feast/blob/master/docs/specs/online_store_format.md#google-datastore-online-store-format
86+
for more details about the data model for this implementation.
87+
88+
Attributes:
89+
_client: Datastore connection.
8590
"""
8691

8792
_client: Optional[datastore.Client] = None

sdk/python/feast/infra/online_stores/dynamodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class DynamoDBOnlineStoreConfig(FeastConfigBaseModel):
6969

7070
class DynamoDBOnlineStore(OnlineStore):
7171
"""
72-
Online feature store for AWS DynamoDB.
72+
AWS DynamoDB implementation of the online store interface.
7373
7474
Attributes:
7575
_dynamodb_client: Boto3 DynamoDB client.

sdk/python/feast/infra/online_stores/online_store.py

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727

2828
class OnlineStore(ABC):
2929
"""
30-
OnlineStore is an object used for all interaction between Feast and the service used for online storage of
31-
features.
30+
The interface that Feast uses to interact with the storage system that handles online features.
3231
"""
3332

3433
@abstractmethod
@@ -42,21 +41,20 @@ def online_write_batch(
4241
progress: Optional[Callable[[int], Any]],
4342
) -> None:
4443
"""
45-
Write a batch of feature rows to the online store. This is a low level interface, not
46-
expected to be used by the users directly.
44+
Writes a batch of feature rows to the online store.
4745
48-
If a tz-naive timestamp is passed to this method, it should be assumed to be UTC by implementors.
46+
If a tz-naive timestamp is passed to this method, it is assumed to be UTC.
4947
5048
Args:
51-
config: The RepoConfig for the current FeatureStore.
52-
table: Feast FeatureView
53-
data: a list of quadruplets containing Feature data. Each quadruplet contains an Entity Key,
54-
a dict containing feature values, an event timestamp for the row, and
55-
the created timestamp for the row if it exists.
56-
progress: Optional function to be called once every mini-batch of rows is written to
57-
the online store. Can be used to display progress.
49+
config: The config for the current feature store.
50+
table: Feature view to which these feature rows correspond.
51+
data: A list of quadruplets containing feature data. Each quadruplet contains an entity
52+
key, a dict containing feature values, an event timestamp for the row, and the created
53+
timestamp for the row if it exists.
54+
progress: Function to be called once a batch of rows is written to the online store, used
55+
to show progress.
5856
"""
59-
...
57+
pass
6058

6159
@abstractmethod
6260
def online_read(
@@ -67,20 +65,20 @@ def online_read(
6765
requested_features: Optional[List[str]] = None,
6866
) -> List[Tuple[Optional[datetime], Optional[Dict[str, ValueProto]]]]:
6967
"""
70-
Read feature values given an Entity Key. This is a low level interface, not
71-
expected to be used by the users directly.
68+
Reads features values for the given entity keys.
7269
7370
Args:
74-
config: The RepoConfig for the current FeatureStore.
75-
table: Feast FeatureView
76-
entity_keys: a list of entity keys that should be read from the FeatureStore.
77-
requested_features: (Optional) A subset of the features that should be read from the FeatureStore.
71+
config: The config for the current feature store.
72+
table: The feature view whose feature values should be read.
73+
entity_keys: The list of entity keys for which feature values should be read.
74+
requested_features: The list of features that should be read.
75+
7876
Returns:
79-
Data is returned as a list, one item per entity key in the original order as the entity_keys argument.
80-
Each item in the list is a tuple of event_ts for the row, and the feature data as a dict from feature names
81-
to values. Values are returned as Value proto message.
77+
A list of the same length as entity_keys. Each item in the list is a tuple where the first
78+
item is the event timestamp for the row, and the second item is a dict mapping feature names
79+
to values, which are returned in proto format.
8280
"""
83-
...
81+
pass
8482

8583
@abstractmethod
8684
def update(
@@ -92,7 +90,21 @@ def update(
9290
entities_to_keep: Sequence[Entity],
9391
partial: bool,
9492
):
95-
...
93+
"""
94+
Reconciles cloud resources with the specified set of Feast objects.
95+
96+
Args:
97+
config: The config for the current feature store.
98+
tables_to_delete: Feature views whose corresponding infrastructure should be deleted.
99+
tables_to_keep: Feature views whose corresponding infrastructure should not be deleted, and
100+
may need to be updated.
101+
entities_to_delete: Entities whose corresponding infrastructure should be deleted.
102+
entities_to_keep: Entities whose corresponding infrastructure should not be deleted, and
103+
may need to be updated.
104+
partial: If true, tables_to_delete and tables_to_keep are not exhaustive lists, so
105+
infrastructure corresponding to other feature views should be not be touched.
106+
"""
107+
pass
96108

97109
def plan(
98110
self, config: RepoConfig, desired_registry_proto: RegistryProto
@@ -101,7 +113,7 @@ def plan(
101113
Returns the set of InfraObjects required to support the desired registry.
102114
103115
Args:
104-
config: The RepoConfig for the current FeatureStore.
116+
config: The config for the current feature store.
105117
desired_registry_proto: The desired registry, in proto form.
106118
"""
107119
return []
@@ -113,4 +125,12 @@ def teardown(
113125
tables: Sequence[FeatureView],
114126
entities: Sequence[Entity],
115127
):
116-
...
128+
"""
129+
Tears down all cloud resources for the specified set of Feast objects.
130+
131+
Args:
132+
config: The config for the current feature store.
133+
tables: Feature views whose corresponding infrastructure should be deleted.
134+
entities: Entities whose corresponding infrastructure should be deleted.
135+
"""
136+
pass

sdk/python/feast/infra/online_stores/redis.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ class RedisOnlineStoreConfig(FeastConfigBaseModel):
7474

7575

7676
class RedisOnlineStore(OnlineStore):
77+
"""
78+
Redis implementation of the online store interface.
79+
80+
See https://github.com/feast-dev/feast/blob/master/docs/specs/online_store_format.md#redis-online-store-format
81+
for more details about the data model for this implementation.
82+
83+
Attributes:
84+
_client: Redis connection.
85+
"""
86+
7787
_client: Optional[Union[Redis, RedisCluster]] = None
7888

7989
def delete_entity_values(self, config: RepoConfig, join_keys: List[str]):

sdk/python/feast/infra/online_stores/sqlite.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ class SqliteOnlineStoreConfig(FeastConfigBaseModel):
5050

5151
class SqliteOnlineStore(OnlineStore):
5252
"""
53-
OnlineStore is an object used for all interaction between Feast and the service used for offline storage of
54-
features.
53+
SQLite implementation of the online store interface. Not recommended for production usage.
5554
5655
Attributes:
5756
_conn: SQLite connection.

0 commit comments

Comments
 (0)