Manage workspaces
A workspace groups related feature sets, jobs, drafts, and reviews together.
note
Workspaces replace the legacy Projects concept, which means any workflow that previously used client.projects now uses client.workspaces.
To initialize the client, see Starting the client.
List workspaces
# Iterate over all workspaces
for workspace in client.workspaces.list():
print(workspace.uid, workspace.name)
# Access by index
first = client.workspaces.list()[0]
# Filter by name
ws = client.workspaces.list(name="default")[0]
# Filter with an AIP-160 expression
ws = client.workspaces.list(query='display_name = "production"')[0]
Count workspaces
total = client.workspaces.count()
Create a workspace
workspace = client.workspaces.create(
name="my-workspace",
description="Workspace for the fraud detection project",
)
The user who creates the workspace is automatically granted the owner role.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | str | Yes | Display name for the workspace. |
description | str | No | Description. Defaults to "". |
Returns a Workspace object.
Get a workspace
# Pass the workspace uid — the identifier part of "workspaces/<uid>"
workspace = client.workspaces.get("ws-abc123")
Workspace properties
| Property | Type | Description |
|---|---|---|
uid | str | Unique identifier. |
name | str | Display name. |
description | str | Description. |
created_time | datetime | When the workspace was created. |
last_modified_time | datetime | When the workspace was last updated. |
access_level | str | "WORKSPACE_ACCESS_LEVEL_PUBLIC" or "WORKSPACE_ACCESS_LEVEL_PRIVATE". |
permission_scope | WorkspacePermissionScope | Whether feature sets inside the workspace are visible to others (see Control workspace access). |
feature_sets | FeatureSets | Feature sets in this workspace. |
drafts | FeatureSetDrafts | Draft feature sets in this workspace. |
reviews | Reviews | Feature set reviews in this workspace. |
jobs | Jobs | Jobs in this workspace. |
print(workspace.uid)
print(workspace.name)
print(workspace.description)
print(workspace.created_time)
print(workspace.last_modified_time)
Update a workspace
Only the fields you pass are updated.
workspace.update(name="fraud-detection-v2")
workspace.update(description="Renamed workspace for fraud detection")
workspace.update(name="fraud-detection-v2", description="Renamed workspace")
# Clear the description
workspace.update(description=None)
Delete a workspace
workspace.delete()
This deletes all feature sets, features, jobs, and other resources in the workspace.
Working with feature sets
Access feature sets through the workspace to keep all operations scoped to it.
# List feature sets in a workspace
for fs in workspace.feature_sets.list():
print(fs.name)
# Register a feature set in a workspace
feature_set = workspace.feature_sets.register(schema=schema, feature_set_name="customer_features")
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai