Skip to content

Commit

Permalink
fix workspace creation
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamrungta committed Mar 8, 2024
1 parent ec5c4ca commit 4530d5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions redbrick/organization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def create_workspace(self, name: str, exists_okay: bool = False) -> RBWorkspace:
"""
Create a workspace within the organization.
This method creates an organization in a similar fashion to the
quickstart on the RedBrick Ai create project page.
This method creates a worspace in a similar fashion to the
quickstart on the RedBrick AI create workspace page.
Parameters
--------------
Expand All @@ -119,8 +119,8 @@ def create_workspace(self, name: str, exists_okay: bool = False) -> RBWorkspace:
)
except ValueError as error:
raise Exception(
"Project with same name exists, try setting exists_okay=True to"
+ " return this project instead of creating a new one"
"Workspace with same name exists, try setting exists_okay=True to"
+ " return this workspace instead of creating a new one"
) from error

return RBWorkspace(self.context, self._org_id, workspace_data["workspaceId"])
Expand All @@ -137,8 +137,8 @@ def create_project_advanced(
"""
Create a project within the organization.
This method creates an organization in a similar fashion to the
quickstart on the RedBrick Ai create project page.
This method creates a project in a similar fashion to the
quickstart on the RedBrick AI create project page.
Parameters
--------------
Expand Down Expand Up @@ -224,8 +224,8 @@ def create_project(
"""
Create a project within the organization.
This method creates an organization in a similar fashion to the
quickstart on the RedBrick Ai create project page.
This method creates a project in a similar fashion to the
quickstart on the RedBrick AI create project page.
Parameters
--------------
Expand Down
6 changes: 3 additions & 3 deletions redbrick/repo/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def create_workspace(
Raise an exception if workspace already exists.
"""
query = """
mutation sdkCreateWorkspaceSDK($orgId: UUID!, $workspaceName: String!){
createWorkspace(orgId: $orgId, workspaceName: $workspaceName){
mutation sdkCreateWorkspaceSDK($orgId: UUID!, $name: String!){
createWorkspace(orgId: $orgId, name: $name){
orgId
workspaceId
name
}
}
"""
variables = {"orgId": org_id, "workspaceName": workspace_name}
variables = {"orgId": org_id, "name": workspace_name}
response: Dict[str, Dict] = self.client.execute_query(query, variables)
if response.get("createWorkspace"):
return response["createWorkspace"]
Expand Down

0 comments on commit 4530d5d

Please sign in to comment.