From 134204a53db49bb4b5b97346f9328c6d74c3a038 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 11 Nov 2024 10:01:05 +0200 Subject: [PATCH] issue 267 --- src/sempy_labs/_model_bpa_bulk.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sempy_labs/_model_bpa_bulk.py b/src/sempy_labs/_model_bpa_bulk.py index e73d4463..dbe9f1b0 100644 --- a/src/sempy_labs/_model_bpa_bulk.py +++ b/src/sempy_labs/_model_bpa_bulk.py @@ -88,6 +88,11 @@ def run_model_bpa_bulk( else: dfW_filt = dfW[dfW["Name"].isin(workspace)] + if len(dfW_filt) == 0: + raise ValueError( + f"{icons.red_dot} There are no valid workspaces to assess. This is likely due to not having proper permissions to the workspace(s) entered in the 'workspace' parameter." + ) + for i, r in dfW_filt.iterrows(): wksp = r["Name"] wksp_id = r["Id"] @@ -151,7 +156,9 @@ def run_model_bpa_bulk( print(e) if len(df) == 0: - print(f"{icons.yellow_dot} No BPA results to save for the '{wksp}' workspace.") + print( + f"{icons.yellow_dot} No BPA results to save for the '{wksp}' workspace." + ) else: df["Severity"].replace(icons.severity_mapping)