Skip to main content
Version: v3.0.0

Find and inspect feature sets

List feature sets in a workspace

note

The list method does not return feature sets directly. Instead, it returns an iterator which obtains the feature sets lazily.

workspace = client.workspaces.list(name="my_workspace")[0]
workspace.feature_sets.list(query=None, advanced_search_options=None)

The query and advancedSearchOption arguments are optional and specify which feature sets should be returned. By default, no filtering options are specified.

To filter feature sets by name, description or tags please use query parameter.

workspace.feature_sets.list(query="My feature")

The advancedSearchOption allows to filter feature sets by feature name, description or tags.

To provide the 'advancedSearchOption' in your requests, follow these steps:

from h2o_featurestore.core.search_operator import SearchOperator
from h2o_featurestore.core.search_field import SearchField
from h2o_featurestore import AdvancedSearchOption
search_options = [AdvancedSearchOption(search_operator=SearchOperator.SEARCH_OPERATOR_LIKE, search_field=SearchField.SEARCH_FIELD_FEATURE_NAME, search_value="super feature")]

workspace.feature_sets.list(advanced_search_options=search_options)

Both parameters could be used together.

You can also list all major versions of the feature set:

fs.major_versions()

This call shows all major versions of the feature set (the current and previous ones).

You can also list all versions of the feature set:

fs.list_versions()

This call shows all versions of the feature set (the current and previous ones).

Listing feature sets across workspaces

workspace.feature_sets.list() is scoped to a single workspace. To search several workspaces at once, or every workspace you can access, use client.workspaces.list_feature_sets().

# List feature sets across specific workspaces
for fs in client.workspaces.list_feature_sets(
workspace_names=["workspaces/<uid_A>", "workspaces/<uid_B>"]
):
print(fs.name)

# List across all accessible workspaces
for fs in client.workspaces.list_feature_sets():
print(fs.name)

Workspaces are identified by their resource name (workspaces/<uid>), not their display name. You can construct this from a workspace object: f"workspaces/{workspace.uid}". Like the workspace-scoped list(), this method returns a lazy iterator (i.e., you can iterate over them without loading everything into memory at once).

Parameters

ParameterTypeRequiredDescription
workspace_nameslist[str]NoWorkspace resource names to search (e.g. "workspaces/<uid>"). Searches all accessible workspaces if omitted.

Returns a generator of FeatureSet objects.

Feature sets found this way can be used as parents of a derived feature set even when they live in another workspace — see Joining feature sets from different workspaces.

Obtaining a feature set

workspace = client.workspaces.list(name="my_workspace")[0]
fs = workspace.feature_sets.get_by_name("feature_set_name", version=None)

If the version is not specified, the latest version of the feature set is returned.

It is also possible to obtain different version of a feature set from some feature set instance as:

fs = feature_set.get_version("2.1")

Commonly used properties

The following table lists the most commonly accessed properties. For the full set of updatable fields, see Update feature set metadata.

PropertyTypeDescription
parentstrWorkspace resource name that owns this feature set (e.g. workspaces/<uid>).
namestrDisplay name of the feature set.
versionstrCurrent version (e.g. 1.0).
descriptionstrDescription.
tagslist[str]User-defined tags.
primary_keylist[str]Primary key column names.
time_travel_columnstr | NoneName of the time travel column, or None if one was not specified at registration (Feature Store creates a virtual one in that case).
deprecatedboolWhether the feature set is deprecated.
featuresdictMap of feature name to Feature object.

Previewing data

You can preview up to a maximum of 100 rows and 50 features.

fs.get_preview()

Feedback