From 4058319c9f03bbd6571591c43975d3a653cc9e8e Mon Sep 17 00:00:00 2001 From: "Alex Power[s] BI" <44716363+itsnotaboutthecell@users.noreply.github.com> Date: Tue, 29 Oct 2024 07:37:22 -0500 Subject: [PATCH] Update _helper_functions.py Updated resolve_workspace_name_and_id to include resolve_workspace_name for a UUID submission. --- src/sempy_labs/_helper_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sempy_labs/_helper_functions.py b/src/sempy_labs/_helper_functions.py index 98a0e384..85f228b9 100644 --- a/src/sempy_labs/_helper_functions.py +++ b/src/sempy_labs/_helper_functions.py @@ -544,7 +544,7 @@ def language_validate(language: str): return lang -def resolve_workspace_name_and_id(workspace: Optional[str] = None) -> Tuple[str, str]: +def resolve_workspace_name_and_id(workspace: Optional[str] | Optional[uuid] = None) -> Tuple[str, str]: """ Obtains the name and ID of the Fabric workspace. @@ -564,6 +564,10 @@ def resolve_workspace_name_and_id(workspace: Optional[str] = None) -> Tuple[str, if workspace is None: workspace_id = fabric.get_workspace_id() workspace = fabric.resolve_workspace_name(workspace_id) + # Workspace Id + if len(workspace) == 36 and all(workspace[i] == '-' for i in [8, 13, 18, 23]): + workspace_id = workspace + workspace = fabric.resolve_workspace_name(workspace_id) else: workspace_id = fabric.resolve_workspace_id(workspace)