feast.infra.online_stores.contrib.rockset_online_store package

Submodules

feast.infra.online_stores.contrib.rockset_online_store.rockset module

class feast.infra.online_stores.contrib.rockset_online_store.rockset.RocksetOnlineStore[source]

Bases: OnlineStore

Rockset implementation of the online store interface.

_rockset_client

Rockset openapi client.

static backoff_sleep(attempts: int, online_config: RocksetOnlineStoreConfig)[source]

Sleep for the needed amount of time based on the number of request attempts.

Parameters:
  • backoff – The amount of time we will sleep for

  • max_backoff – The max amount of time we should ever backoff for.

  • rate_limited – Whether this method is being called as part of a rate limited request.

static delete_collection(rs: RocksetClient, collection_name: str)[source]

Deletes the collection whose name was provided

Parameters:
  • rs – The RocksetClient to be used for the deletion.

  • collection_name – The name of the collection to be deleted.

static get_collection_name(config: RepoConfig, feature_view: FeatureView) str[source]

Returns the collection name based on the provided config and FeatureView.

Parameters:
  • config – RepoConfig for the online store.

  • feature_view – FeatureView that is backed by the returned collection name.

Returns:

The collection name as a string.

get_rockset_client(onlineConfig: RocksetOnlineStoreConfig) RocksetClient[source]

Fetches the RocksetClient to be used for all requests for this online store based on the api configuration in the provided config. If no configuration provided local ENV vars will be used.

Parameters:

onlineConfig – The RocksetOnlineStoreConfig associated with this online store.

online_read(config: RepoConfig, table: FeatureView, entity_keys: List[EntityKey], requested_features: List[str] | None = None) List[Tuple[datetime | None, Dict[str, Value] | None]][source]

Retrieve feature values from the online Rockset store.

Parameters:
  • config – The RepoConfig for the current FeatureStore.

  • table – Feast FeatureView.

  • entity_keys – a list of entity keys that should be read from the FeatureStore.

online_write_batch(config: RepoConfig, table: FeatureView, data: List[Tuple[EntityKey, Dict[str, Value], datetime, datetime | None]], progress: Callable[[int], Any] | None) None[source]

Write a batch of feature rows to online Rockset store.

Parameters:
  • config – The RepoConfig for the current FeatureStore.

  • table – Feast FeatureView.

  • data – a list of quadruplets containing Feature data. Each quadruplet contains an Entity Key,

  • values (a dict containing feature) –

  • row (an event timestamp for the) –

  • and

  • exists. (the created timestamp for the row if it) –

  • progress – Optional function to be called once every mini-batch of rows is written to

  • progress. (the online store. Can be used to display) –

static parse_request_error_type(e: RocksetException) str[source]

Parse a throw RocksetException. Will return a string representing the type of error that was thrown.

Parameters:

e – The RockException that is being parsed.

Returns:

Error type parsed as a string.

teardown(config: RepoConfig, tables: Sequence[FeatureView], entities: Sequence[Entity])[source]

Delete all collections from the Rockset Online Store.

Parameters:
  • config – The RepoConfig for the current FeatureStore.

  • tables – Tables to delete from the feature repo.

update(config: RepoConfig, tables_to_delete: Sequence[FeatureView], tables_to_keep: Sequence[FeatureView], entities_to_delete: Sequence[Entity], entities_to_keep: Sequence[Entity], partial: bool)[source]

Update tables from the Rockset Online Store.

Parameters:
  • config – The RepoConfig for the current FeatureStore.

  • tables_to_delete – Tables to delete from the Rockset Online Store.

  • tables_to_keep – Tables to keep in the Rockset Online Store.

static wait_for_fence(rs: RocksetClient, collection_name: str, last_offset: str, online_config: RocksetOnlineStoreConfig)[source]

Waits until ‘last_offset’ is flushed and values are ready to be read. If wait lasts longer than the timeout specified in config a timeout exception will be throw.

Parameters:
  • rs – Rockset client that will be used to make all requests.

  • collection_name – Collection associated with the offsets we are waiting for.

  • last_offset – The actual offsets we are waiting to be flushed.

  • online_config – The config that will be used to determine timeouts and backout configurations.

static wait_for_ready_collections(rs: RocksetClient, collection_names: List[str], online_config: RocksetOnlineStoreConfig)[source]

Waits until all collections provided have entered READY state and can accept new documents. If wait lasts longer than timeout a TimeoutError exception will be thrown.

Parameters:
  • rs – Rockset client that will be used to make all requests.

  • collection_names – All collections that we will wait for.

  • timeout – The max amount of time we will wait for the collections to become READY.

class feast.infra.online_stores.contrib.rockset_online_store.rockset.RocksetOnlineStoreConfig(*, type: Literal['rockset'] = 'rockset', api_key: str | None = None, host: str | None = None, read_pagination_batch_size: int = 100, collection_created_timeout_secs: int = 60, collection_ready_timeout_secs: int = 1800, fence_all_writes: bool = True, fence_timeout_secs: int = 600, initial_request_backoff_secs: int = 2, max_request_backoff_secs: int = 30, max_request_attempts: int = 10000)[source]

Bases: FeastConfigBaseModel

Online store config for Rockset store

api_key: str | None

Api Key to be used for Rockset Account. If not set the env var ROCKSET_APIKEY will be used.

collection_created_timeout_secs: int

The amount of time, in seconds, we will wait for the collection to become visible to the API

collection_ready_timeout_secs: int

The amount of time, in seconds, we will wait for the collection to enter READY state

fence_all_writes: bool

Whether to wait for all writes to be flushed from log and queryable. If False, documents that are written may not be seen immediately in subsequent reads

fence_timeout_secs: int

The amount of time we will wait, in seconds, for the write fence to be passed

host: str | None

The Host Url for Rockset requests. If not set the env var ROCKSET_APISERVER will be used.

initial_request_backoff_secs: int

Initial backoff, in seconds, we will wait between requests when polling for a response

max_request_attempts: int

The max amount of times we will retry a failed request

max_request_backoff_secs: int

Initial backoff, in seconds, we will wait between requests when polling for a response

read_pagination_batch_size: int

Batch size of records that will be turned per page when paginating a batched read

type: Literal['rockset']

Online store type selector

Module contents