Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions singlestoredb/management/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ def create_starter_workspace(
database_name : str
Name of the database for the starter workspace
workspace_group : dict[str, str]
Workspace group input (dict with keys: 'cell_id')
Workspace group input (dict with keys: 'cell_id' and 'name').

Returns
-------
Expand All @@ -1875,15 +1875,16 @@ def create_starter_workspace(
if not workspace_group or not isinstance(workspace_group, dict):
raise ValueError(
'workspace_group must be a dict with keys: '
"'cell_id'",
"'cell_id' and 'name'",
)
if set(workspace_group.keys()) != {'cell_id'}:
raise ValueError("workspace_group must contain only 'cell_id'")
if set(workspace_group.keys()) != {'cell_id', 'name'}:
raise ValueError("workspace_group must contain only 'cell_id' and 'name'")

payload = {
'name': name,
'databaseName': database_name,
'workspaceGroup': {
'name': workspace_group['name'],
'cellID': workspace_group['cell_id'],
},
}
Expand Down
1 change: 1 addition & 0 deletions singlestoredb/tests/test_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ def setUpClass(cls):
f'starter-ws-test-{name}',
database_name=f'starter_db_{name}',
workspace_group={
'name': f'starter-wg-test-{name}',
'cell_id': random.choice(us_regions).id,
},
)
Expand Down