online_store_spec

Classes

class databricks.feature_store.online_store_spec.online_store_spec.OnlineStoreSpec(_type, hostname: [<class 'str'>, None] = None, port: [<class 'int'>, None] = None, user: Optional[str] = None, password: Optional[str] = None, database_name: Optional[str] = None, table_name: Optional[str] = None, driver_name: Optional[str] = None, read_secret_prefix: Optional[str] = None, write_secret_prefix: Optional[str] = None, _internal_properties: Optional[Dict[str, str]] = None)

Bases: abc.ABC

Parent class for all types of OnlineStoreSpec objects.

Abstract base class for classes that specify the online store to publish to.

If database_name and table_name are not provided, FeatureStoreClient.publish_table will use the offline store’s database and table names.

To use a different database and table name in the online store, provide values for both database_name and table_name arguments.

The JDBC driver can be customized with the optional driver_name argument. Otherwise, a default is used.

Strings in the primary key should not exceed 100 characters.

The online database should already exist.

Note

It is strongly suggested (but not required), to provide read-only database credentials via the read_secret_prefix in order to grant the least amount of database access privileges to the served model. When providing a read_secret_prefix, the secrets must exist in the scope name using the expected format, otherwise publish_table will return an error.

Parameters
  • hostname – Hostname to access online store. The database hostname cannot be changed. Subsequent publish calls to the same online store must provide the same hostname.

  • port – Port number to access online store. The database port cannot be changed. Subsequent publish calls to the same online store must provide the same port.

  • user – Username that has write access to the online store, or None if using write_secret_prefix.

  • password – Password to access the online store, or None if using write_secret_prefix.

  • database_name – Database name.

  • table_name – Table name.

  • driver_name – Name of custom JDBC driver to access the online store.

  • read_secret_prefix

    The secret scope name and secret key name prefix where read-only online store credentials are stored. These credentials will be used during online feature serving to connect to the online store from the served model. The format of this parameter should be ${scope-name}/${prefix}, which is the name of the secret scope, followed by a /, followed by the secret key name prefix. The scope passed in must contain the following keys and corresponding values:

    • ${prefix}-user where ${prefix} is the value passed into this function. For example if this function is called with datascience/staging, the datascience secret scope should contain the secret named staging-user, which points to a secret value with the database username for the online store.

    • ${prefix}-password where ${prefix} is the value passed into this function. For example if this function is called with datascience/staging, the datascience secret scope should contain the secret named staging-password, which points to a secret value with the database password for the online store.

    Once the read_secret_prefix is set for an online store, it cannot be changed.

  • write_secret_prefix

    The secret scope name and secret key name prefix where read-write online store credentials are stored. These credentials will be used to connect to the online store to publish features. If user and password are passed, this field must be None, or an exception will be raised. The format of this parameter should be ${scope-name}/${prefix}, which is the name of the secret scope, followed by a /, followed by the secret key name prefix. The scope passed in must contain the following keys and corresponding values:

    • ${prefix}-user where ${prefix} is the value passed into this function. For example if this function is called with datascience/staging, the datascience secret scope should contain the secret named staging-user, which points to a secret value with the database username for the online store.

    • ${prefix}-password where ${prefix} is the value passed into this function. For example if this function is called with datascience/staging, the datascience secret scope should contain the secret named staging-password, which points to a secret value with the database password for the online store.

Methods

auth_type()

Publish Auth type.

clone(**kwargs)

Clone a feature spec.

non_secret_properties()

TODO (ML-21692): Determine if this function is required and update for use if necessary.

Dictionary of non-secret properties.

Properties

type

Type of the online store.

table_name

Table name.

user

Username that has access to the online store.

Property will be empty if write_scret_prefix argument was used.

password

Password to access the online store.

Property will be empty if write_scret_prefix argument was used.

driver

Name of the custom JDBC driver to access the online store.

read_secret_prefix

Prefix for read access to online store.

Name of the secret scope and prefix that contains the username and password to access the online store with read-only credentials.

See the read_secret_prefix parameter description for details.

write_secret_prefix

Secret prefix that contains online store login info.

Name of the secret scope and prefix that contains the username and password to access the online store with read/write credentials. See the write_secret_prefix parameter description for details.

cloud

Cloud provider where this online store is located.

store_type

Store type.

auth_type()

Publish Auth type.