semantic-link-labs 0.12.0__py3-none-any.whl → 0.12.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of semantic-link-labs might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: semantic-link-labs
3
- Version: 0.12.0
3
+ Version: 0.12.1
4
4
  Summary: Semantic Link Labs for Microsoft Fabric
5
5
  Author: Microsoft Corporation
6
6
  License: MIT License
@@ -26,7 +26,7 @@ Dynamic: license-file
26
26
  # Semantic Link Labs
27
27
 
28
28
  [![PyPI version](https://badge.fury.io/py/semantic-link-labs.svg)](https://badge.fury.io/py/semantic-link-labs)
29
- [![Read The Docs](https://readthedocs.org/projects/semantic-link-labs/badge/?version=0.12.0&style=flat)](https://readthedocs.org/projects/semantic-link-labs/)
29
+ [![Read The Docs](https://readthedocs.org/projects/semantic-link-labs/badge/?version=0.12.1&style=flat)](https://readthedocs.org/projects/semantic-link-labs/)
30
30
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
31
31
  [![Downloads](https://static.pepy.tech/badge/semantic-link-labs)](https://pepy.tech/project/semantic-link-labs)
32
32
 
@@ -154,6 +154,7 @@ An even better way to ensure the semantic-link-labs library is available in your
154
154
  2. Select your newly created environment within the 'Environment' drop down in the navigation bar at the top of the notebook
155
155
 
156
156
  ## Version History
157
+ * [0.12.1](https://github.com/microsoft/semantic-link-labs/releases/tag/0.12.1) (September 4, 2025)
157
158
  * [0.12.0](https://github.com/microsoft/semantic-link-labs/releases/tag/0.12.0) (September 2, 2025)
158
159
  * [0.11.3](https://github.com/microsoft/semantic-link-labs/releases/tag/0.11.3) (August 6, 2025)
159
160
  * [0.11.2](https://github.com/microsoft/semantic-link-labs/releases/tag/0.11.2) (July 8, 2025)
@@ -1,8 +1,8 @@
1
- semantic_link_labs-0.12.0.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
1
+ semantic_link_labs-0.12.1.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
2
2
  sempy_labs/__init__.py,sha256=XXjFqLjr5HXuCNTE_zs2Goyjk-TXXsiBdz5DeNBPjxs,16188
3
- sempy_labs/_a_lib_info.py,sha256=NoXoV9JWoeL18kF7o2nTsdaoWyr4c4_MbZs1XbnV0b8,53
3
+ sempy_labs/_a_lib_info.py,sha256=T42IY7w9DbMr4dEI7yZNEWVAdGYwER_A1tX9Ro4_xgE,53
4
4
  sempy_labs/_ai.py,sha256=fiI3RCadJ2jG15vZIWD9rKVhvmGWoD9uth9-PlSPBNs,16196
5
- sempy_labs/_authentication.py,sha256=gW5QNHbzSrvJIrD_0nAH0HkHClc9bAvnnJFO6atecKc,8448
5
+ sempy_labs/_authentication.py,sha256=-mSXB3tlVhutOo2nhmQQOllWWVvuy4G9rTM77v4S8lw,8485
6
6
  sempy_labs/_capacities.py,sha256=TQYlbM0LP21G-KsW6QrJ7heBzKL42XxA939VldWiKeg,40436
7
7
  sempy_labs/_capacity_migration.py,sha256=g675DY2YgsVA_ffb_8WNdARVMyHh8iu2P94QWLllmDY,24827
8
8
  sempy_labs/_clear_cache.py,sha256=UY_pljGeqb168Qe5sP66ecLeREPN4NMpjIEocCmxg0M,13201
@@ -105,7 +105,7 @@ sempy_labs/admin/_activities.py,sha256=SN-uAEWvFO5nKuw4Yi483niixzxShDGMXRv0SV4s4
105
105
  sempy_labs/admin/_apps.py,sha256=4R-VZqo9SGIrwqcQfnFGXIWueBhr4mSI7H8SUlLVl8s,4131
106
106
  sempy_labs/admin/_artifacts.py,sha256=IQ1BOVKMK8Qy_5HpREUso6_NWXbftIodWekByvVvJ5k,2315
107
107
  sempy_labs/admin/_basic_functions.py,sha256=HfJhdh8tVskRaaypU3qD_EE6IaDDR3MKJyt9Bl-56LE,16306
108
- sempy_labs/admin/_capacities.py,sha256=jdRLY57cYb4I5-DlXO_E8Vari45JFxIvy4KK0nZk3BQ,16657
108
+ sempy_labs/admin/_capacities.py,sha256=nanec6kuyuUNjP1iseOoVmVax5VLKzOW0_91oESzEE4,16693
109
109
  sempy_labs/admin/_dataflows.py,sha256=So7kzRdDZ2henr-gmPw-ahEBQTm_xGhZrjkW-gALLQk,1432
110
110
  sempy_labs/admin/_datasets.py,sha256=scGbRZpR32u62HDsvKaUYtpX85n4RGx4eYjxClFIT5U,6277
111
111
  sempy_labs/admin/_domains.py,sha256=siLhIi5UqVM9kf_Xqq-kzvwZKouyqf-wWpPhJ7D-VMk,15238
@@ -172,12 +172,10 @@ sempy_labs/report/_report_bpa_rules.py,sha256=kPPE1UZ_78GePULcIRUarRfdqR7s4CQ46M
172
172
  sempy_labs/report/_report_functions.py,sha256=cBJhjoC6iNYF-I6Ak1a2i2EKQykA5TPVLoofkgsuMkk,20105
173
173
  sempy_labs/report/_report_helper.py,sha256=L9wU0N0rvTUMglZHTxcowywrBDuZvZTv3DA4JrX84Os,7207
174
174
  sempy_labs/report/_report_list_functions.py,sha256=m_Wf1YeZmNtOfCwIILpKUuVR7V2CnwnfhDjz1DDTxOI,3945
175
- sempy_labs/report/_report_rebind.py,sha256=acdnCUHzH_U8Elu2bvSD4p3xX-cEwKSQe9lVYzx3i7A,5850
175
+ sempy_labs/report/_report_rebind.py,sha256=c4-dPCvjqnwdsasjCFlsTo8w6TvhAQ7WPRmAb-mowns,6437
176
176
  sempy_labs/report/_reportwrapper.py,sha256=GI38yGY_mXlFhE-WD8-0oHlL6kmU-M_kBcPp1qozgt0,110493
177
177
  sempy_labs/report/_save_report.py,sha256=0P1WwIBtSgwrhnjWWvf9xf-e7ifka3DWVF0HM5zeXps,5998
178
- sempy_labs/report/_bpareporttemplate/.platform,sha256=kWRa6B_KwSYLsvVFDx372mQriQO8v7dJ_YzQV_cfD-Q,303
179
178
  sempy_labs/report/_bpareporttemplate/definition.pbir,sha256=bttyHZYKqjA8OBb_cezGlX4H82cDvGZVCl1QB3fij4E,343
180
- sempy_labs/report/_bpareporttemplate/.pbi/localSettings.json,sha256=kzjBlNdjbsSBBSHBwbQc298AJCr9Vp6Ex0D5PemUuT0,1578
181
179
  sempy_labs/report/_bpareporttemplate/StaticResources/SharedResources/BaseThemes/CY24SU06.json,sha256=4N6sT5nLlYBobGmZ1Xb68uOMVVCBEyheR535js_et28,13467
182
180
  sempy_labs/report/_bpareporttemplate/definition/report.json,sha256=-8BK5blTE-nc0Y4-M0pTHD8Znt3pHZ-u2veRppxPDBQ,3975
183
181
  sempy_labs/report/_bpareporttemplate/definition/version.json,sha256=yL3ZZqhfHqq0MS0glrbXtQgkPk17xaTSWvPPyxBWpOc,152
@@ -210,7 +208,7 @@ sempy_labs/tom/__init__.py,sha256=ZwSpgYDP5VamZTnYP3a1cYHiaKdktOvlOBSOY1816zY,10
210
208
  sempy_labs/tom/_model.py,sha256=W74vT2th6UfMFrvfWKXV20ieIMZIaoEDr1Y5SUpZUA0,222514
211
209
  sempy_labs/variable_library/__init__.py,sha256=qyTw5vNldnwYv-TotQSFupwznKIQfcws1UxGjf1RNNo,437
212
210
  sempy_labs/variable_library/_functions.py,sha256=eoB3hUKFGdGMSBNDEsEF9bVoELZp5AnyDxp5BsLGeDc,13733
213
- semantic_link_labs-0.12.0.dist-info/METADATA,sha256=9ob_p1JPBLfQ9Fmhh-J2YAVOjMZsdCP-wKz7Om9W7rI,27445
214
- semantic_link_labs-0.12.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
215
- semantic_link_labs-0.12.0.dist-info/top_level.txt,sha256=kiQX1y42Dbein1l3Q8jMUYyRulDjdlc2tMepvtrvixQ,11
216
- semantic_link_labs-0.12.0.dist-info/RECORD,,
211
+ semantic_link_labs-0.12.1.dist-info/METADATA,sha256=pT9s2npkcYOCBOOAbEbFPoDqw_Qky5z_13WMH4bpgYc,27545
212
+ semantic_link_labs-0.12.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
213
+ semantic_link_labs-0.12.1.dist-info/top_level.txt,sha256=kiQX1y42Dbein1l3Q8jMUYyRulDjdlc2tMepvtrvixQ,11
214
+ semantic_link_labs-0.12.1.dist-info/RECORD,,
sempy_labs/_a_lib_info.py CHANGED
@@ -1,2 +1,2 @@
1
1
  lib_name = "semanticlinklabs"
2
- lib_version = "0.12.0"
2
+ lib_version = "0.12.1"
@@ -19,7 +19,7 @@ class ServicePrincipalTokenProvider(TokenCredential):
19
19
  "azure": "https://management.azure.com/.default",
20
20
  "graph": "https://graph.microsoft.com/.default",
21
21
  "asazure": "https://{region}.asazure.windows.net/.default",
22
- "keyvault": "https://vault.azure.net/.default"
22
+ "keyvault": "https://vault.azure.net/.default",
23
23
  }
24
24
 
25
25
  def __init__(self, credential: ClientSecretCredential):
@@ -152,10 +152,14 @@ class ServicePrincipalTokenProvider(TokenCredential):
152
152
  scopes = ("pbi",)
153
153
 
154
154
  region = kwargs.pop("region", None)
155
- scopes = [self._get_fully_qualified_scope(scope, region=region) for scope in scopes]
155
+ scopes = [
156
+ self._get_fully_qualified_scope(scope, region=region) for scope in scopes
157
+ ]
156
158
  return self.credential.get_token(*scopes, **kwargs)
157
159
 
158
- def _get_fully_qualified_scope(self, scope: str, region: Optional[str] = None) -> str:
160
+ def _get_fully_qualified_scope(
161
+ self, scope: str, region: Optional[str] = None
162
+ ) -> str:
159
163
  """
160
164
  Resolve to fully qualified scope if Fabric short-handed scope is given.
161
165
  Otherwise, return the original scope.
@@ -285,16 +285,16 @@ def list_capacities(
285
285
  "Users": i.get("users", []),
286
286
  }
287
287
 
288
- if include_tenant_key:
289
- tenant_key = i.get("tenantKey") or {}
290
- row.update(
291
- {
292
- "Tenant Key Id": tenant_key.get("id"),
293
- "Tenant Key Name": tenant_key.get("name"),
294
- }
295
- )
296
-
297
- rows.append(row)
288
+ if include_tenant_key:
289
+ tenant_key = i.get("tenantKey") or {}
290
+ row.update(
291
+ {
292
+ "Tenant Key Id": tenant_key.get("id"),
293
+ "Tenant Key Name": tenant_key.get("name"),
294
+ }
295
+ )
296
+
297
+ rows.append(row)
298
298
 
299
299
  if rows:
300
300
  df = pd.DataFrame(rows, columns=list(columns.keys()))
@@ -12,8 +12,8 @@ from uuid import UUID
12
12
 
13
13
  @log
14
14
  def report_rebind(
15
- report: str | List[str],
16
- dataset: str,
15
+ report: str | UUID | List[str | UUID],
16
+ dataset: str | UUID,
17
17
  report_workspace: Optional[str | UUID] = None,
18
18
  dataset_workspace: Optional[str | UUID] = None,
19
19
  ):
@@ -77,47 +77,50 @@ def report_rebind(
77
77
 
78
78
  @log
79
79
  def report_rebind_all(
80
- dataset: str,
81
- new_dataset: str,
82
- dataset_workspace: Optional[str] = None,
83
- new_dataset_workpace: Optional[str] = None,
84
- report_workspace: Optional[str | List[str]] = None,
80
+ dataset: str | UUID,
81
+ new_dataset: str | UUID,
82
+ dataset_workspace: Optional[str | UUID] = None,
83
+ new_dataset_workspace: Optional[str | UUID] = None,
84
+ report_workspace: Optional[str | UUID | List[str | UUID]] = None,
85
85
  ):
86
86
  """
87
- Rebinds all reports across all workspaces which are bound to a specific semantic model to a new semantic model.
87
+ Rebinds all reports across the provided report workspaces which are bound to a specific semantic model to a new semantic model.
88
88
 
89
89
  Service Principal Authentication is supported (see `here <https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Service%20Principal.ipynb>`_ for examples).
90
90
 
91
91
  Parameters
92
92
  ----------
93
- dataset : str
93
+ dataset : str | uuid.UUID
94
94
  Name of the semantic model currently binded to the reports.
95
- new_dataset : str
95
+ new_dataset : str | uuid.UUID
96
96
  Name of the semantic model to rebind to the reports.
97
- dataset_workspace : str, default=None
97
+ dataset_workspace : str | uuid.UUID, default=None
98
98
  The name of the Fabric workspace in which the original semantic model resides.
99
99
  Defaults to None which resolves to the workspace of the attached lakehouse
100
100
  or if no lakehouse attached, resolves to the workspace of the notebook.
101
- new_dataset_workspace : str, default=None
101
+ new_dataset_workspace : str | uuid.UUID, default=None
102
102
  The name of the Fabric workspace in which the new semantic model resides.
103
103
  Defaults to None which resolves to the workspace of the attached lakehouse
104
104
  or if no lakehouse attached, resolves to the workspace of the notebook.
105
- report_workspace : str | List[str], default=None
106
- The name(s) of the Fabric workspace(s) in which the report(s) reside(s).
105
+ report_workspace : str | uuid.UUID | List[str | uuid.UUID], default=None
106
+ The name(s) or IDs of the Fabric workspace(s) in which the report(s) reside(s).
107
107
  Defaults to None which finds all reports in all workspaces which use the semantic model and rebinds them to
108
108
  the new semantic model.
109
109
  """
110
110
 
111
111
  from sempy_labs._list_functions import list_reports_using_semantic_model
112
112
 
113
- if dataset == new_dataset:
114
- raise ValueError(
115
- f"{icons.red_dot} The 'dataset' and 'new_dataset' parameters are both set to '{dataset}'. These parameters must be set to different values."
116
- )
117
-
118
113
  (dataset_name, dataset_id) = resolve_dataset_name_and_id(
119
114
  dataset=dataset, workspace=dataset_workspace
120
115
  )
116
+ (new_dataset_name, new_dataset_id) = resolve_dataset_name_and_id(
117
+ dataset=new_dataset, workspace=new_dataset_workspace
118
+ )
119
+
120
+ if dataset_id == new_dataset_id:
121
+ raise ValueError(
122
+ f"{icons.red_dot} The 'dataset' and 'new_dataset' parameters are both set to '{dataset}'. These parameters must be set to different values."
123
+ )
121
124
  (dataset_workspace_name, dataset_workspace_id) = resolve_workspace_name_and_id(
122
125
  workspace=dataset_workspace
123
126
  )
@@ -129,7 +132,7 @@ def report_rebind_all(
129
132
  dataset=dataset, workspace=dataset_workspace
130
133
  )
131
134
 
132
- if len(dfR) == 0:
135
+ if dfR.empty:
133
136
  print(
134
137
  f"{icons.info} The '{dataset_name}' semantic model within the '{dataset_workspace_name}' workspace has no dependent reports."
135
138
  )
@@ -138,9 +141,18 @@ def report_rebind_all(
138
141
  if report_workspace is None:
139
142
  dfR_filt = dfR.copy()
140
143
  else:
141
- dfR_filt = dfR[dfR["Report Workspace Name"].isin(report_workspace)]
144
+ dfR_filt = dfR[
145
+ (dfR["Report Workspace Name"].isin(report_workspace))
146
+ | (dfR["Report Workspace ID"].isin(report_workspace))
147
+ ]
148
+
149
+ if dfR_filt.empty:
150
+ print(
151
+ f"{icons.info} No reports found for the '{dataset_name}' semantic model within the '{dataset_workspace_name}' workspace."
152
+ )
153
+ return
142
154
 
143
- for i, r in dfR_filt.iterrows():
155
+ for _, r in dfR_filt.iterrows():
144
156
  rpt_name = r["Report Name"]
145
157
  rpt_wksp = r["Report Workspace Name"]
146
158
 
@@ -148,5 +160,5 @@ def report_rebind_all(
148
160
  report=rpt_name,
149
161
  dataset=new_dataset,
150
162
  report_workspace=rpt_wksp,
151
- dataset_workspace=new_dataset_workpace,
163
+ dataset_workspace=new_dataset_workspace,
152
164
  )
@@ -1,9 +0,0 @@
1
- {
2
- "version": "1.0",
3
- "remoteArtifacts": [
4
- {
5
- "reportId": "6a91c344-dba8-4ebf-bedb-e07134f2a204"
6
- }
7
- ],
8
- "securityBindingsSignature": "AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAMAVu7l76YU6Sl11KOiJdgQAAAAACAAAAAAAQZgAAAAEAACAAAAD1Ty+c7tZLT9/Sjguxhn/5ivfLWfUMNtgudyJ3BKzzZgAAAAAOgAAAAAIAACAAAABAyGf+iKMwvmNtcoRczjgebeIm0nlc9SFYTBYv3N7yvVADAADQN3JsIsvJUcKKc9WMo2EhiE21odezpd35tb+yudHwA/RYhypMA3fwiCTwArLefBZQ3vZ7KYh4MjihXS07i9o1XVqxAmDoli83Yhs/Wei+0HIfYOT5HOVHLUEul5x41Yx/7Bdfhc881SK6IoaJogBdwsiJVxPne+niMYqJQA6qLEPyJ33g6ucUxLA40lwdbN2cMWFzRn6tymmicDPwH0hcGPDMWwseAU+OuUeidkneRWhUGs6lkiiXLiO6kmY5RKq+S4FdtR19/e1B6EjAd94zSw+M5jQzYxn4eCZzWYiB+8Zd/jy07lfyLoGwagNqiQzbcNONqQd5w0n+8/+n4zGkBi2UojfRXoGaYDirQeZMTbt3pfPx2PArxsJ8dF0iT634pHiCF1ZFdtY+79JaFLUUG+Yf7JJv8IxuuuF74tAp4NYmuOij4hTDaf8Jafa5IoRVh7ICkwrjJyVQ8dG7I3tr0VvR+toBPG3Zlbm9BijcaBxhh1AINhnRAIkENOnPFQVH7l3Ml7B60H8Tst6ic3ihCCMYjtmN+NNWqFrJKT2trilh5TAxN+ei4H5fPwM9S7zb2bH5jhExcYTtoe7iCzxOvBsoYoFM+7FMjn9R2FATNICktYdbKDo1Of+u4oZ1+RsvBHQBVaMhSCoZ7+K5T5pZayNK3V2UID3wOuLOYvouxXXr4NVFsdgiV2oMuxTWeqmd/4bLxeqe3uTkGFmQU4mumF2YVsNbdO3IcRXhhrCCZ27ffzXBsH+lE3EhusD37Z0dsVbVVlG8AHXCh7Atgd8n73/eSI5mvj36DCOSRBVauItIATIa2FXueKA7vU6lRDYBSX8FCC2qkeN6dWpMoN5uXXEBsb5Yot1Fgrovcyl5lk7rh772Xon4FaIYFHZpklsY3JK5EXp3bF8UOE6ByN1ZucmkGgYRcTT/up/Uc86TLN6env9XXL4FQYPlReiOGWKBLVi9OoXGRLDshspniULtV3EwQ6WsjF2AyQ+WdLj3bbWKzG5Mg9jvANLrjycZAGWskh4X5JDGiv4TiJmnYQ/xPZAKKiowpVIHikLeG76uXFI+bxtpihV9+DaEJy4UxisHQxwuvUsQs38u3SHgpJmT8CNssZl41+T/IJdoQwJFLUAAAACnUQZGV9DvcOyrj8HBpXBVB5PuOQDxLB4HZOevHqCB5dc5z787E93B51QmN7I15fF6GCdWwN5f94gv1er2dtN3"
9
- }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/fabric/gitIntegration/platformProperties/2.0.0/schema.json",
3
- "metadata": {
4
- "type": "Report",
5
- "displayName": "BPAReport"
6
- },
7
- "config": {
8
- "version": "2.0",
9
- "logicalId": "a201f2cd-fd25-465f-bfbc-33b151e38b31"
10
- }
11
- }