Skip to content

Commit 62f3151

Browse files
committed
fixes per comments
1 parent 038dfba commit 62f3151

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

src/sempy_labs/admin/_basic_functions.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,15 +905,15 @@ def _resolve_workspace_name_and_id(
905905
workspace_name = fabric.resolve_workspace_name(workspace_id)
906906
else:
907907
dfW = list_workspaces(workspace=workspace)
908-
try:
908+
if not dfW.empty:
909909
workspace_name = dfW["Name"].iloc[0]
910910
workspace_id = dfW["Id"].iloc[0]
911-
except Exception:
911+
else:
912912
raise ValueError(
913913
f"{icons.red_dot} The '{workspace}' workspace was not found."
914914
)
915915

916-
return workspace_name, workspace_id
916+
return workspace_name, workspace_id
917917

918918

919919
def list_reports(
@@ -996,6 +996,23 @@ def list_reports(
996996

997997

998998
def get_capacity_assignment_status(workspace: Optional[str | UUID] = None):
999+
"""
1000+
Gets the status of the assignment-to-capacity operation for the specified workspace.
1001+
1002+
This is a wrapper function for the following API: `Capacities - Groups CapacityAssignmentStatus <https://learn.microsoft.com/rest/api/power-bi/capacities/groups-capacity-assignment-status>`_.
1003+
1004+
Parameters
1005+
----------
1006+
workspace : str | UUID, default=None
1007+
The Fabric workspace name or id.
1008+
Defaults to None which resolves to the workspace of the attached lakehouse
1009+
or if no lakehouse attached, resolves to the workspace of the notebook.
1010+
1011+
Returns
1012+
-------
1013+
pandas.DataFrame
1014+
A pandas dataframe showing the status of the assignment-to-capacity operation for the specified workspace.
1015+
"""
9991016

10001017
(workspace_name, workspace_id) = _resolve_workspace_name_and_id(workspace)
10011018

src/sempy_labs/admin/_scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def scan_workspaces(
4040
4141
Returns
4242
-------
43-
dictionary
43+
dict
4444
A json object with the scan result.
4545
"""
4646
scan_result = {

0 commit comments

Comments
 (0)