From 551eae392581d5994d61bf8e0a78ac890f11543b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 19 Nov 2024 09:22:33 +0200 Subject: [PATCH] fixed issue 288 --- src/sempy_labs/_git.py | 4 ++-- src/sempy_labs/_model_bpa.py | 17 ++--------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/sempy_labs/_git.py b/src/sempy_labs/_git.py index b4bd4f02..934288fa 100644 --- a/src/sempy_labs/_git.py +++ b/src/sempy_labs/_git.py @@ -229,7 +229,7 @@ def initialize_git_connection(workspace: Optional[str] = None) -> str: The Fabric workspace name. 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 ------- str @@ -250,7 +250,7 @@ def initialize_git_connection(workspace: Optional[str] = None) -> str: f"{icons.green_dot} The '{workspace}' workspace git connection has been initialized." ) - return response.json()['remoteCommitHash'] + return response.json()["remoteCommitHash"] def commit_to_git( diff --git a/src/sempy_labs/_model_bpa.py b/src/sempy_labs/_model_bpa.py index b019da2a..49955c3e 100644 --- a/src/sempy_labs/_model_bpa.py +++ b/src/sempy_labs/_model_bpa.py @@ -400,23 +400,10 @@ def translate_using_spark(rule_file): dfExport["Timestamp"] = now dfExport["RunId"] = runId dfExport["Configured By"] = configured_by - dfExport["RunId"] = dfExport["RunId"].astype("int") - colName = "Capacity Name" - dfExport.insert(0, colName, dfExport.pop(colName)) - colName = "Capacity Id" - dfExport.insert(1, colName, dfExport.pop(colName)) - colName = "Workspace Name" - dfExport.insert(2, colName, dfExport.pop(colName)) - colName = "Workspace Id" - dfExport.insert(3, colName, dfExport.pop(colName)) - colName = "Dataset Name" - dfExport.insert(4, colName, dfExport.pop(colName)) - colName = "Configured By" - dfExport.insert(5, colName, dfExport.pop(colName)) - - dfExport.columns = dfExport.columns.str.replace(" ", "_") + dfExport = dfExport[list(icons.bpa_schema.keys())] + dfExport["RunId"] = dfExport["RunId"].astype("int") schema = { key.replace(" ", "_"): value for key, value in icons.bpa_schema.items() }