Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kovalsky committed Sep 10, 2024
1 parent 5f2f3ea commit a42ec1b
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/sempy_labs/_list_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1828,9 +1828,6 @@ def create_custom_pool(
The name of the Fabric workspace.
Defaults to None which resolves to the workspace of the attached lakehouse
or if no lakehouse attached, resolves to the workspace of the notebook.
Returns
-------
"""

# https://learn.microsoft.com/en-us/rest/api/fabric/spark/custom-pools/create-workspace-custom-pool
Expand Down Expand Up @@ -1911,9 +1908,6 @@ def update_custom_pool(
The name of the Fabric workspace.
Defaults to None which resolves to the workspace of the attached lakehouse
or if no lakehouse attached, resolves to the workspace of the notebook.
Returns
-------
"""

# https://learn.microsoft.com/en-us/rest/api/fabric/spark/custom-pools/update-workspace-custom-pool?tabs=HTTP
Expand Down Expand Up @@ -1986,9 +1980,6 @@ def delete_custom_pool(pool_name: str, workspace: Optional[str] = None):
The name of the Fabric workspace.
Defaults to None which resolves to the workspace of the attached lakehouse
or if no lakehouse attached, resolves to the workspace of the notebook.
Returns
-------
"""

(workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
Expand Down Expand Up @@ -2024,15 +2015,16 @@ def assign_workspace_to_capacity(capacity_name: str, workspace: Optional[str] =
The name of the Fabric workspace.
Defaults to None which resolves to the workspace of the attached lakehouse
or if no lakehouse attached, resolves to the workspace of the notebook.
Returns
-------
"""

(workspace, workspace_id) = resolve_workspace_name_and_id(workspace)

dfC = fabric.list_capacities()
dfC_filt = dfC[dfC["Display Name"] == capacity_name]

if len(dfC_filt) == 0:
raise ValueError(f"{icons.red_dot} The '{capacity_name}' capacity does not exist.")

capacity_id = dfC_filt["Id"].iloc[0]

request_body = {"capacityId": capacity_id}
Expand All @@ -2041,7 +2033,6 @@ def assign_workspace_to_capacity(capacity_name: str, workspace: Optional[str] =
response = client.post(
f"/v1/workspaces/{workspace_id}/assignToCapacity",
json=request_body,
lro_wait=True,
)

if response.status_code not in [200, 202]:
Expand All @@ -2061,9 +2052,6 @@ def unassign_workspace_from_capacity(workspace: Optional[str] = None):
The name of the Fabric workspace.
Defaults to None which resolves to the workspace of the attached lakehouse
or if no lakehouse attached, resolves to the workspace of the notebook.
Returns
-------
"""

# https://learn.microsoft.com/en-us/rest/api/fabric/core/workspaces/unassign-from-capacity?tabs=HTTP
Expand Down

0 comments on commit a42ec1b

Please sign in to comment.