Skip to content

Commit

Permalink
fixes per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kovalsky committed Dec 4, 2024
1 parent 038dfba commit 62f3151
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions src/sempy_labs/admin/_basic_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,15 +905,15 @@ def _resolve_workspace_name_and_id(
workspace_name = fabric.resolve_workspace_name(workspace_id)
else:
dfW = list_workspaces(workspace=workspace)
try:
if not dfW.empty:
workspace_name = dfW["Name"].iloc[0]
workspace_id = dfW["Id"].iloc[0]
except Exception:
else:
raise ValueError(
f"{icons.red_dot} The '{workspace}' workspace was not found."
)

return workspace_name, workspace_id
return workspace_name, workspace_id


def list_reports(
Expand Down Expand Up @@ -996,6 +996,23 @@ def list_reports(


def get_capacity_assignment_status(workspace: Optional[str | UUID] = None):
"""
Gets the status of the assignment-to-capacity operation for the specified workspace.
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>`_.
Parameters
----------
workspace : str | UUID, default=None
The Fabric workspace name or id.
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
-------
pandas.DataFrame
A pandas dataframe showing the status of the assignment-to-capacity operation for the specified workspace.
"""

(workspace_name, workspace_id) = _resolve_workspace_name_and_id(workspace)

Expand Down
2 changes: 1 addition & 1 deletion src/sempy_labs/admin/_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def scan_workspaces(
Returns
-------
dictionary
dict
A json object with the scan result.
"""
scan_result = {
Expand Down

0 comments on commit 62f3151

Please sign in to comment.