semantic-link-labs 0.9.0__py3-none-any.whl → 0.9.2__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.
- {semantic_link_labs-0.9.0.dist-info → semantic_link_labs-0.9.2.dist-info}/METADATA +68 -7
- {semantic_link_labs-0.9.0.dist-info → semantic_link_labs-0.9.2.dist-info}/RECORD +83 -76
- sempy_labs/__init__.py +14 -12
- sempy_labs/_authentication.py +0 -2
- sempy_labs/_capacities.py +120 -142
- sempy_labs/_capacity_migration.py +61 -94
- sempy_labs/_clear_cache.py +9 -8
- sempy_labs/_connections.py +72 -105
- sempy_labs/_data_pipelines.py +47 -49
- sempy_labs/_dataflows.py +45 -51
- sempy_labs/_dax.py +228 -6
- sempy_labs/_delta_analyzer.py +303 -0
- sempy_labs/_deployment_pipelines.py +72 -66
- sempy_labs/_environments.py +39 -36
- sempy_labs/_eventhouses.py +35 -35
- sempy_labs/_eventstreams.py +38 -39
- sempy_labs/_external_data_shares.py +29 -42
- sempy_labs/_gateways.py +57 -101
- sempy_labs/_generate_semantic_model.py +22 -30
- sempy_labs/_git.py +46 -66
- sempy_labs/_graphQL.py +95 -0
- sempy_labs/_helper_functions.py +175 -30
- sempy_labs/_job_scheduler.py +47 -59
- sempy_labs/_kql_databases.py +27 -34
- sempy_labs/_kql_querysets.py +23 -30
- sempy_labs/_list_functions.py +262 -164
- sempy_labs/_managed_private_endpoints.py +52 -47
- sempy_labs/_mirrored_databases.py +110 -134
- sempy_labs/_mirrored_warehouses.py +13 -13
- sempy_labs/_ml_experiments.py +36 -36
- sempy_labs/_ml_models.py +37 -38
- sempy_labs/_model_dependencies.py +2 -0
- sempy_labs/_notebooks.py +28 -29
- sempy_labs/_one_lake_integration.py +2 -0
- sempy_labs/_query_scale_out.py +63 -81
- sempy_labs/_refresh_semantic_model.py +12 -14
- sempy_labs/_spark.py +54 -79
- sempy_labs/_sql.py +7 -11
- sempy_labs/_vertipaq.py +8 -3
- sempy_labs/_warehouses.py +30 -33
- sempy_labs/_workloads.py +15 -20
- sempy_labs/_workspace_identity.py +13 -17
- sempy_labs/_workspaces.py +49 -48
- sempy_labs/admin/__init__.py +2 -0
- sempy_labs/admin/_basic_functions.py +244 -281
- sempy_labs/admin/_domains.py +188 -103
- sempy_labs/admin/_external_data_share.py +26 -31
- sempy_labs/admin/_git.py +17 -22
- sempy_labs/admin/_items.py +34 -48
- sempy_labs/admin/_scanner.py +20 -13
- sempy_labs/directlake/_directlake_schema_compare.py +2 -0
- sempy_labs/directlake/_dl_helper.py +10 -11
- sempy_labs/directlake/_generate_shared_expression.py +4 -5
- sempy_labs/directlake/_get_directlake_lakehouse.py +1 -0
- sempy_labs/directlake/_list_directlake_model_calc_tables.py +1 -0
- sempy_labs/directlake/_show_unsupported_directlake_objects.py +2 -0
- sempy_labs/directlake/_warm_cache.py +2 -0
- sempy_labs/graph/__init__.py +33 -0
- sempy_labs/graph/_groups.py +402 -0
- sempy_labs/graph/_teams.py +113 -0
- sempy_labs/graph/_users.py +191 -0
- sempy_labs/lakehouse/__init__.py +4 -0
- sempy_labs/lakehouse/_get_lakehouse_columns.py +10 -10
- sempy_labs/lakehouse/_get_lakehouse_tables.py +14 -20
- sempy_labs/lakehouse/_lakehouse.py +101 -4
- sempy_labs/lakehouse/_shortcuts.py +42 -20
- sempy_labs/migration/__init__.py +4 -0
- sempy_labs/migration/_direct_lake_to_import.py +66 -0
- sempy_labs/migration/_migrate_calctables_to_lakehouse.py +1 -0
- sempy_labs/migration/_migrate_calctables_to_semantic_model.py +1 -0
- sempy_labs/migration/_migrate_model_objects_to_semantic_model.py +1 -0
- sempy_labs/migration/_migrate_tables_columns_to_semantic_model.py +2 -0
- sempy_labs/report/_download_report.py +8 -13
- sempy_labs/report/_generate_report.py +49 -46
- sempy_labs/report/_paginated.py +20 -26
- sempy_labs/report/_report_functions.py +50 -45
- sempy_labs/report/_report_list_functions.py +2 -0
- sempy_labs/report/_report_rebind.py +6 -10
- sempy_labs/report/_reportwrapper.py +187 -220
- sempy_labs/tom/_model.py +8 -5
- {semantic_link_labs-0.9.0.dist-info → semantic_link_labs-0.9.2.dist-info}/LICENSE +0 -0
- {semantic_link_labs-0.9.0.dist-info → semantic_link_labs-0.9.2.dist-info}/WHEEL +0 -0
- {semantic_link_labs-0.9.0.dist-info → semantic_link_labs-0.9.2.dist-info}/top_level.txt +0 -0
sempy_labs/_workspaces.py
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import sempy.fabric as fabric
|
|
2
1
|
import pandas as pd
|
|
3
2
|
import sempy_labs._icons as icons
|
|
4
3
|
from typing import Optional
|
|
5
4
|
from sempy_labs._helper_functions import (
|
|
6
5
|
resolve_workspace_name_and_id,
|
|
7
|
-
pagination,
|
|
8
6
|
resolve_capacity_id,
|
|
7
|
+
_base_api,
|
|
8
|
+
_create_dataframe,
|
|
9
9
|
)
|
|
10
|
-
from sempy.fabric.exceptions import FabricHTTPException
|
|
11
10
|
from uuid import UUID
|
|
12
11
|
|
|
13
12
|
|
|
@@ -31,11 +30,10 @@ def delete_user_from_workspace(
|
|
|
31
30
|
|
|
32
31
|
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
raise FabricHTTPException(response)
|
|
33
|
+
_base_api(
|
|
34
|
+
request=f"/v1.0/myorg/groups/{workspace_id}/users/{email_address}",
|
|
35
|
+
method="delete",
|
|
36
|
+
)
|
|
39
37
|
print(
|
|
40
38
|
f"{icons.green_dot} The '{email_address}' user has been removed from accessing the '{workspace_name}' workspace."
|
|
41
39
|
)
|
|
@@ -81,18 +79,18 @@ def update_workspace_user(
|
|
|
81
79
|
f"{icons.red_dot} Invalid princpal type. Valid options: {principal_types}."
|
|
82
80
|
)
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
payload = {
|
|
85
83
|
"emailAddress": email_address,
|
|
86
84
|
"groupUserAccessRight": role_name,
|
|
87
85
|
"principalType": principal_type,
|
|
88
86
|
"identifier": email_address,
|
|
89
87
|
}
|
|
90
88
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
_base_api(
|
|
90
|
+
request=f"/v1.0/myorg/groups/{workspace_id}/users",
|
|
91
|
+
method="put",
|
|
92
|
+
payload=payload,
|
|
93
|
+
)
|
|
96
94
|
print(
|
|
97
95
|
f"{icons.green_dot} The '{email_address}' user has been updated to a '{role_name}' within the '{workspace_name}' workspace."
|
|
98
96
|
)
|
|
@@ -119,13 +117,18 @@ def list_workspace_users(workspace: Optional[str | UUID] = None) -> pd.DataFrame
|
|
|
119
117
|
|
|
120
118
|
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
121
119
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
columns = {
|
|
121
|
+
"User Name": "string",
|
|
122
|
+
"Email Address": "string",
|
|
123
|
+
"Role": "string",
|
|
124
|
+
"Type": "string",
|
|
125
|
+
"User ID": "string",
|
|
126
|
+
}
|
|
127
|
+
df = _create_dataframe(columns=columns)
|
|
127
128
|
|
|
128
|
-
responses =
|
|
129
|
+
responses = _base_api(
|
|
130
|
+
request=f"v1/workspaces/{workspace_id}/roleAssignments", uses_pagination=True
|
|
131
|
+
)
|
|
129
132
|
|
|
130
133
|
for r in responses:
|
|
131
134
|
for v in r.get("value", []):
|
|
@@ -183,21 +186,18 @@ def add_user_to_workspace(
|
|
|
183
186
|
f"{icons.red_dot} Invalid princpal type. Valid options: {principal_types}."
|
|
184
187
|
)
|
|
185
188
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
request_body = {
|
|
189
|
+
payload = {
|
|
189
190
|
"emailAddress": email_address,
|
|
190
191
|
"groupUserAccessRight": role_name,
|
|
191
192
|
"principalType": principal_type,
|
|
192
193
|
"identifier": email_address,
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
|
|
196
|
-
f"/v1.0/myorg/groups/{workspace_id}/users",
|
|
196
|
+
_base_api(
|
|
197
|
+
request=f"/v1.0/myorg/groups/{workspace_id}/users",
|
|
198
|
+
method="post",
|
|
199
|
+
payload=payload,
|
|
197
200
|
)
|
|
198
|
-
|
|
199
|
-
if response.status_code != 200:
|
|
200
|
-
raise FabricHTTPException(response)
|
|
201
201
|
print(
|
|
202
202
|
f"{icons.green_dot} The '{email_address}' user has been added as a{plural} '{role_name}' within the '{workspace_name}' workspace."
|
|
203
203
|
)
|
|
@@ -224,16 +224,14 @@ def assign_workspace_to_capacity(
|
|
|
224
224
|
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
225
225
|
capacity_id = resolve_capacity_id(capacity_name=capacity_name)
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
payload = {"capacityId": capacity_id}
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
_base_api(
|
|
230
|
+
request=f"/v1/workspaces/{workspace_id}/assignToCapacity",
|
|
231
|
+
method="post",
|
|
232
|
+
payload=payload,
|
|
233
|
+
status_codes=[200, 202],
|
|
233
234
|
)
|
|
234
|
-
|
|
235
|
-
if response.status_code not in [200, 202]:
|
|
236
|
-
raise FabricHTTPException(response)
|
|
237
235
|
print(
|
|
238
236
|
f"{icons.green_dot} The '{workspace_name}' workspace has been assigned to the '{capacity_name}' capacity."
|
|
239
237
|
)
|
|
@@ -255,11 +253,11 @@ def unassign_workspace_from_capacity(workspace: Optional[str | UUID] = None):
|
|
|
255
253
|
|
|
256
254
|
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
257
255
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
256
|
+
_base_api(
|
|
257
|
+
request=f"/v1/workspaces/{workspace_id}/unassignFromCapacity",
|
|
258
|
+
method="post",
|
|
259
|
+
status_codes=[200, 202],
|
|
260
|
+
)
|
|
263
261
|
print(
|
|
264
262
|
f"{icons.green_dot} The '{workspace_name}' workspace has been unassigned from its capacity."
|
|
265
263
|
)
|
|
@@ -288,14 +286,17 @@ def list_workspace_role_assignments(
|
|
|
288
286
|
|
|
289
287
|
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
290
288
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
columns = {
|
|
290
|
+
"User Name": "string",
|
|
291
|
+
"User Email": "string",
|
|
292
|
+
"Role Name": "string",
|
|
293
|
+
"Type": "string",
|
|
294
|
+
}
|
|
295
|
+
df = _create_dataframe(columns=columns)
|
|
297
296
|
|
|
298
|
-
responses =
|
|
297
|
+
responses = _base_api(
|
|
298
|
+
request=f"v1/workspaces/{workspace_id}/roleAssignments", uses_pagination=True
|
|
299
|
+
)
|
|
299
300
|
|
|
300
301
|
for r in responses:
|
|
301
302
|
for i in r.get("value", []):
|
sempy_labs/admin/__init__.py
CHANGED
|
@@ -15,6 +15,7 @@ from sempy_labs.admin._basic_functions import (
|
|
|
15
15
|
list_access_entities,
|
|
16
16
|
list_activity_events,
|
|
17
17
|
get_capacity_assignment_status,
|
|
18
|
+
get_capacity_state,
|
|
18
19
|
)
|
|
19
20
|
from sempy_labs.admin._domains import (
|
|
20
21
|
list_domains,
|
|
@@ -70,4 +71,5 @@ __all__ = [
|
|
|
70
71
|
"list_reports",
|
|
71
72
|
"get_capacity_assignment_status",
|
|
72
73
|
"scan_workspaces",
|
|
74
|
+
"get_capacity_state",
|
|
73
75
|
]
|