semantic-link-labs 0.11.1__py3-none-any.whl → 0.11.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.11.1.dist-info → semantic_link_labs-0.11.2.dist-info}/METADATA +5 -4
- semantic_link_labs-0.11.2.dist-info/RECORD +210 -0
- sempy_labs/__init__.py +56 -56
- sempy_labs/_a_lib_info.py +1 -1
- sempy_labs/_ai.py +1 -1
- sempy_labs/_capacities.py +2 -2
- sempy_labs/_capacity_migration.py +5 -5
- sempy_labs/_clear_cache.py +1 -1
- sempy_labs/_connections.py +2 -2
- sempy_labs/_dashboards.py +16 -16
- sempy_labs/_data_pipelines.py +1 -1
- sempy_labs/_dataflows.py +101 -26
- sempy_labs/_dax.py +3 -3
- sempy_labs/_dax_query_view.py +1 -1
- sempy_labs/_delta_analyzer.py +4 -4
- sempy_labs/_delta_analyzer_history.py +1 -1
- sempy_labs/_deployment_pipelines.py +1 -1
- sempy_labs/_environments.py +22 -21
- sempy_labs/_eventhouses.py +12 -11
- sempy_labs/_eventstreams.py +12 -11
- sempy_labs/_external_data_shares.py +23 -22
- sempy_labs/_gateways.py +47 -45
- sempy_labs/_generate_semantic_model.py +3 -3
- sempy_labs/_git.py +1 -1
- sempy_labs/_graphQL.py +12 -11
- sempy_labs/_job_scheduler.py +56 -54
- sempy_labs/_kql_databases.py +16 -17
- sempy_labs/_kql_querysets.py +12 -11
- sempy_labs/_kusto.py +2 -2
- sempy_labs/_list_functions.py +1 -1
- sempy_labs/_managed_private_endpoints.py +18 -15
- sempy_labs/_mirrored_databases.py +16 -15
- sempy_labs/_mirrored_warehouses.py +12 -11
- sempy_labs/_ml_experiments.py +11 -10
- sempy_labs/_ml_models.py +11 -10
- sempy_labs/_model_auto_build.py +3 -3
- sempy_labs/_model_bpa.py +5 -5
- sempy_labs/_model_bpa_bulk.py +3 -3
- sempy_labs/_model_dependencies.py +1 -1
- sempy_labs/_mounted_data_factories.py +12 -12
- sempy_labs/_notebooks.py +1 -1
- sempy_labs/_one_lake_integration.py +1 -1
- sempy_labs/_query_scale_out.py +1 -1
- sempy_labs/_refresh_semantic_model.py +1 -1
- sempy_labs/_semantic_models.py +30 -28
- sempy_labs/_spark.py +1 -1
- sempy_labs/_sql.py +1 -1
- sempy_labs/_sql_endpoints.py +12 -11
- sempy_labs/_sqldatabase.py +15 -15
- sempy_labs/_tags.py +11 -10
- sempy_labs/_translations.py +1 -1
- sempy_labs/_user_delegation_key.py +2 -2
- sempy_labs/_variable_libraries.py +13 -12
- sempy_labs/_vertipaq.py +3 -3
- sempy_labs/_vpax.py +1 -1
- sempy_labs/_warehouses.py +15 -14
- sempy_labs/_workloads.py +1 -1
- sempy_labs/_workspace_identity.py +1 -1
- sempy_labs/_workspaces.py +14 -13
- sempy_labs/admin/__init__.py +18 -18
- sempy_labs/admin/_activities.py +46 -46
- sempy_labs/admin/_apps.py +28 -26
- sempy_labs/admin/_artifacts.py +15 -15
- sempy_labs/admin/_basic_functions.py +1 -2
- sempy_labs/admin/_capacities.py +84 -82
- sempy_labs/admin/_dataflows.py +2 -2
- sempy_labs/admin/_datasets.py +50 -48
- sempy_labs/admin/_domains.py +25 -19
- sempy_labs/admin/_external_data_share.py +24 -22
- sempy_labs/admin/_git.py +17 -17
- sempy_labs/admin/_items.py +47 -45
- sempy_labs/admin/_reports.py +61 -58
- sempy_labs/admin/_scanner.py +2 -2
- sempy_labs/admin/_shared.py +18 -18
- sempy_labs/admin/_tags.py +2 -2
- sempy_labs/admin/_tenant.py +57 -51
- sempy_labs/admin/_users.py +16 -15
- sempy_labs/admin/_workspaces.py +2 -2
- sempy_labs/directlake/__init__.py +12 -12
- sempy_labs/directlake/_directlake_schema_compare.py +3 -3
- sempy_labs/directlake/_directlake_schema_sync.py +9 -7
- sempy_labs/directlake/_dl_helper.py +1 -1
- sempy_labs/directlake/_generate_shared_expression.py +1 -1
- sempy_labs/directlake/_get_directlake_lakehouse.py +1 -1
- sempy_labs/directlake/_guardrails.py +1 -1
- sempy_labs/directlake/_list_directlake_model_calc_tables.py +3 -3
- sempy_labs/directlake/_show_unsupported_directlake_objects.py +1 -1
- sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py +3 -3
- sempy_labs/directlake/_update_directlake_partition_entity.py +4 -4
- sempy_labs/directlake/_warm_cache.py +3 -3
- sempy_labs/graph/__init__.py +3 -3
- sempy_labs/graph/_groups.py +81 -78
- sempy_labs/graph/_teams.py +21 -21
- sempy_labs/graph/_users.py +111 -10
- sempy_labs/lakehouse/__init__.py +7 -7
- sempy_labs/lakehouse/_blobs.py +30 -30
- sempy_labs/lakehouse/_get_lakehouse_columns.py +2 -2
- sempy_labs/lakehouse/_get_lakehouse_tables.py +29 -27
- sempy_labs/lakehouse/_helper.py +30 -2
- sempy_labs/lakehouse/_lakehouse.py +2 -2
- sempy_labs/lakehouse/_livy_sessions.py +47 -42
- sempy_labs/lakehouse/_shortcuts.py +22 -21
- sempy_labs/migration/__init__.py +8 -8
- sempy_labs/migration/_create_pqt_file.py +2 -2
- sempy_labs/migration/_migrate_calctables_to_lakehouse.py +3 -3
- sempy_labs/migration/_migrate_calctables_to_semantic_model.py +3 -4
- sempy_labs/migration/_migrate_model_objects_to_semantic_model.py +2 -2
- sempy_labs/migration/_migrate_tables_columns_to_semantic_model.py +4 -4
- sempy_labs/migration/_migration_validation.py +1 -2
- sempy_labs/migration/_refresh_calc_tables.py +2 -2
- sempy_labs/mirrored_azure_databricks_catalog/__init__.py +2 -2
- sempy_labs/mirrored_azure_databricks_catalog/_discover.py +40 -40
- sempy_labs/mirrored_azure_databricks_catalog/_refresh_catalog_metadata.py +1 -1
- sempy_labs/report/__init__.py +10 -10
- sempy_labs/report/_download_report.py +2 -2
- sempy_labs/report/_export_report.py +2 -2
- sempy_labs/report/_generate_report.py +1 -1
- sempy_labs/report/_paginated.py +1 -1
- sempy_labs/report/_report_bpa.py +4 -3
- sempy_labs/report/_report_functions.py +3 -3
- sempy_labs/report/_report_list_functions.py +3 -3
- sempy_labs/report/_report_rebind.py +1 -1
- sempy_labs/report/_reportwrapper.py +247 -249
- sempy_labs/report/_save_report.py +3 -3
- sempy_labs/theme/_org_themes.py +19 -6
- sempy_labs/tom/__init__.py +1 -1
- sempy_labs/tom/_model.py +5 -5
- semantic_link_labs-0.11.1.dist-info/RECORD +0 -210
- {semantic_link_labs-0.11.1.dist-info → semantic_link_labs-0.11.2.dist-info}/WHEEL +0 -0
- {semantic_link_labs-0.11.1.dist-info → semantic_link_labs-0.11.2.dist-info}/licenses/LICENSE +0 -0
- {semantic_link_labs-0.11.1.dist-info → semantic_link_labs-0.11.2.dist-info}/top_level.txt +0 -0
sempy_labs/admin/__init__.py
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
from
|
|
1
|
+
from ._users import (
|
|
2
2
|
list_access_entities,
|
|
3
3
|
list_user_subscriptions,
|
|
4
4
|
)
|
|
5
|
-
from
|
|
5
|
+
from ._workspaces import (
|
|
6
6
|
add_user_to_workspace,
|
|
7
7
|
delete_user_from_workspace,
|
|
8
8
|
restore_deleted_workspace,
|
|
9
9
|
list_orphaned_workspaces,
|
|
10
10
|
)
|
|
11
|
-
from
|
|
11
|
+
from ._artifacts import (
|
|
12
12
|
list_unused_artifacts,
|
|
13
13
|
)
|
|
14
|
-
from
|
|
14
|
+
from ._shared import (
|
|
15
15
|
list_widely_shared_artifacts,
|
|
16
16
|
)
|
|
17
|
-
from
|
|
17
|
+
from ._datasets import (
|
|
18
18
|
list_datasets,
|
|
19
19
|
list_dataset_users,
|
|
20
20
|
)
|
|
21
|
-
from
|
|
21
|
+
from ._apps import (
|
|
22
22
|
list_apps,
|
|
23
23
|
list_app_users,
|
|
24
24
|
)
|
|
25
|
-
from
|
|
25
|
+
from ._reports import (
|
|
26
26
|
list_reports,
|
|
27
27
|
list_report_users,
|
|
28
28
|
list_report_subscriptions,
|
|
29
29
|
)
|
|
30
|
-
from
|
|
30
|
+
from ._activities import (
|
|
31
31
|
list_activity_events,
|
|
32
32
|
)
|
|
33
|
-
from
|
|
33
|
+
from ._scanner import (
|
|
34
34
|
scan_workspaces,
|
|
35
35
|
)
|
|
36
|
-
from
|
|
36
|
+
from ._capacities import (
|
|
37
37
|
patch_capacity,
|
|
38
38
|
list_capacities,
|
|
39
39
|
get_capacity_assignment_status,
|
|
@@ -41,7 +41,7 @@ from sempy_labs.admin._capacities import (
|
|
|
41
41
|
list_capacity_users,
|
|
42
42
|
get_refreshables,
|
|
43
43
|
)
|
|
44
|
-
from
|
|
44
|
+
from ._tenant import (
|
|
45
45
|
list_tenant_settings,
|
|
46
46
|
delete_capacity_tenant_setting_override,
|
|
47
47
|
update_tenant_setting,
|
|
@@ -51,7 +51,7 @@ from sempy_labs.admin._tenant import (
|
|
|
51
51
|
list_capacities_delegated_tenant_settings,
|
|
52
52
|
list_domain_tenant_settings_overrides,
|
|
53
53
|
)
|
|
54
|
-
from
|
|
54
|
+
from ._basic_functions import (
|
|
55
55
|
assign_workspaces_to_capacity,
|
|
56
56
|
unassign_workspaces_from_capacity,
|
|
57
57
|
list_workspaces,
|
|
@@ -59,7 +59,7 @@ from sempy_labs.admin._basic_functions import (
|
|
|
59
59
|
list_modified_workspaces,
|
|
60
60
|
list_workspace_users,
|
|
61
61
|
)
|
|
62
|
-
from
|
|
62
|
+
from ._domains import (
|
|
63
63
|
list_domains,
|
|
64
64
|
list_domain_workspaces,
|
|
65
65
|
assign_domain_workspaces,
|
|
@@ -71,21 +71,21 @@ from sempy_labs.admin._domains import (
|
|
|
71
71
|
unassign_domain_workspaces,
|
|
72
72
|
unassign_all_domain_workspaces,
|
|
73
73
|
)
|
|
74
|
-
from
|
|
74
|
+
from ._items import (
|
|
75
75
|
list_item_access_details,
|
|
76
76
|
list_items,
|
|
77
77
|
)
|
|
78
|
-
from
|
|
78
|
+
from ._external_data_share import (
|
|
79
79
|
list_external_data_shares,
|
|
80
80
|
revoke_external_data_share,
|
|
81
81
|
)
|
|
82
|
-
from
|
|
82
|
+
from ._git import (
|
|
83
83
|
list_git_connections,
|
|
84
84
|
)
|
|
85
|
-
from
|
|
85
|
+
from ._dataflows import (
|
|
86
86
|
export_dataflow,
|
|
87
87
|
)
|
|
88
|
-
from
|
|
88
|
+
from ._tags import (
|
|
89
89
|
list_tags,
|
|
90
90
|
create_tags,
|
|
91
91
|
delete_tag,
|
sempy_labs/admin/_activities.py
CHANGED
|
@@ -2,7 +2,7 @@ import pandas as pd
|
|
|
2
2
|
from typing import Optional
|
|
3
3
|
from dateutil.parser import parse as dtparser
|
|
4
4
|
from sempy._utils._log import log
|
|
5
|
-
from
|
|
5
|
+
from .._helper_functions import (
|
|
6
6
|
_base_api,
|
|
7
7
|
_create_dataframe,
|
|
8
8
|
_update_dataframe_datatypes,
|
|
@@ -107,60 +107,60 @@ def list_activity_events(
|
|
|
107
107
|
|
|
108
108
|
responses = _base_api(request=url, client="fabric_sp", uses_pagination=True)
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
rows = []
|
|
112
111
|
for r in responses:
|
|
113
112
|
if return_dataframe:
|
|
114
113
|
for i in r.get("activityEventEntities", []):
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
114
|
+
rows.append(
|
|
115
|
+
{
|
|
116
|
+
"Id": i.get("Id"),
|
|
117
|
+
"Record Type": i.get("RecordType"),
|
|
118
|
+
"Creation Time": i.get("CreationTime"),
|
|
119
|
+
"Operation": i.get("Operation"),
|
|
120
|
+
"Organization Id": i.get("OrganizationId"),
|
|
121
|
+
"User Type": i.get("UserType"),
|
|
122
|
+
"User Key": i.get("UserKey"),
|
|
123
|
+
"Workload": i.get("Workload"),
|
|
124
|
+
"Result Status": i.get("ResultStatus"),
|
|
125
|
+
"User Id": i.get("UserId"),
|
|
126
|
+
"Client IP": i.get("ClientIP"),
|
|
127
|
+
"User Agent": i.get("UserAgent"),
|
|
128
|
+
"Activity": i.get("Activity"),
|
|
129
|
+
"Workspace Name": i.get("WorkSpaceName"),
|
|
130
|
+
"Workspace Id": i.get("WorkspaceId"),
|
|
131
|
+
"Object Id": i.get("ObjectId"),
|
|
132
|
+
"Request Id": i.get("RequestId"),
|
|
133
|
+
"Object Type": i.get("ObjectType"),
|
|
134
|
+
"Object Display Name": i.get("ObjectDisplayName"),
|
|
135
|
+
"Experience": i.get("Experience"),
|
|
136
|
+
"Refresh Enforcement Policy": i.get("RefreshEnforcementPolicy"),
|
|
137
|
+
"Is Success": i.get("IsSuccess"),
|
|
138
|
+
"Activity Id": i.get("ActivityId"),
|
|
139
|
+
"Item Name": i.get("ItemName"),
|
|
140
|
+
"Dataset Name": i.get("DatasetName"),
|
|
141
|
+
"Report Name": i.get("ReportName"),
|
|
142
|
+
"Capacity Id": i.get("CapacityId"),
|
|
143
|
+
"Capacity Name": i.get("CapacityName"),
|
|
144
|
+
"App Name": i.get("AppName"),
|
|
145
|
+
"Dataset Id": i.get("DatasetId"),
|
|
146
|
+
"Report Id": i.get("ReportId"),
|
|
147
|
+
"Artifact Id": i.get("ArtifactId"),
|
|
148
|
+
"Artifact Name": i.get("ArtifactName"),
|
|
149
|
+
"Report Type": i.get("ReportType"),
|
|
150
|
+
"App Report Id": i.get("AppReportId"),
|
|
151
|
+
"Distribution Method": i.get("DistributionMethod"),
|
|
152
|
+
"Consumption Method": i.get("ConsumptionMethod"),
|
|
153
|
+
"Artifact Kind": i.get("ArtifactKind"),
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
156
|
else:
|
|
157
157
|
response_json["activityEventEntities"].extend(
|
|
158
158
|
r.get("activityEventEntities")
|
|
159
159
|
)
|
|
160
160
|
|
|
161
161
|
if return_dataframe:
|
|
162
|
-
if
|
|
163
|
-
df = pd.
|
|
162
|
+
if rows:
|
|
163
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
164
164
|
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
165
165
|
return df
|
|
166
166
|
else:
|
sempy_labs/admin/_apps.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pandas as pd
|
|
2
2
|
from typing import Optional
|
|
3
|
-
from
|
|
3
|
+
from .._helper_functions import (
|
|
4
4
|
_build_url,
|
|
5
5
|
_base_api,
|
|
6
6
|
_create_dataframe,
|
|
@@ -58,19 +58,20 @@ def list_apps(
|
|
|
58
58
|
url = _build_url(url, params)
|
|
59
59
|
response = _base_api(request=url, client="fabric_sp")
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
rows = []
|
|
62
62
|
for v in response.json().get("value", []):
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
rows.append(
|
|
64
|
+
{
|
|
65
|
+
"App Name": v.get("name"),
|
|
66
|
+
"App Id": v.get("id"),
|
|
67
|
+
"Description": v.get("description"),
|
|
68
|
+
"Published By": v.get("publishedBy"),
|
|
69
|
+
"Last Update": v.get("lastUpdate"),
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
if rows:
|
|
74
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
74
75
|
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
75
76
|
|
|
76
77
|
return df
|
|
@@ -124,20 +125,21 @@ def list_app_users(app: str | UUID) -> pd.DataFrame:
|
|
|
124
125
|
url = f"/v1.0/myorg/admin/apps/{app_id}/users"
|
|
125
126
|
response = _base_api(request=url, client="fabric_sp")
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
rows = []
|
|
128
129
|
for v in response.json().get("value", []):
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
rows.append(
|
|
131
|
+
{
|
|
132
|
+
"User Name": v.get("displayName"),
|
|
133
|
+
"Email Address": v.get("emailAddress"),
|
|
134
|
+
"App User Access Right": v.get("appUserAccessRight"),
|
|
135
|
+
"Identifier": v.get("identifier"),
|
|
136
|
+
"Graph Id": v.get("graphId"),
|
|
137
|
+
"Principal Type": v.get("principalType"),
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
if rows:
|
|
142
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
141
143
|
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
142
144
|
|
|
143
145
|
return df
|
sempy_labs/admin/_artifacts.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import pandas as pd
|
|
2
|
-
from
|
|
2
|
+
from .._helper_functions import (
|
|
3
3
|
_base_api,
|
|
4
4
|
)
|
|
5
5
|
from uuid import UUID
|
|
6
6
|
from typing import Optional
|
|
7
|
-
from
|
|
7
|
+
from ._basic_functions import (
|
|
8
8
|
_resolve_workspace_name_and_id,
|
|
9
9
|
_create_dataframe,
|
|
10
10
|
_update_dataframe_datatypes,
|
|
@@ -46,22 +46,22 @@ def list_unused_artifacts(workspace: Optional[str | UUID] = None) -> pd.DataFram
|
|
|
46
46
|
uses_pagination=True,
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
rows = []
|
|
50
50
|
for r in responses:
|
|
51
51
|
for i in r.get("unusedArtifactEntities", []):
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
rows.append(
|
|
53
|
+
{
|
|
54
|
+
"Artifact Name": i.get("displayName"),
|
|
55
|
+
"Artifact Id": i.get("artifactId"),
|
|
56
|
+
"Artifact Type": i.get("artifactType"),
|
|
57
|
+
"Artifact Size in MB": i.get("artifactSizeInMB"),
|
|
58
|
+
"Created Date Time": i.get("createdDateTime"),
|
|
59
|
+
"Last Accessed Date Time": i.get("lastAccessedDateTime"),
|
|
60
|
+
}
|
|
61
|
+
)
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if dfs:
|
|
64
|
-
df = pd.concat(dfs, ignore_index=True)
|
|
63
|
+
if rows:
|
|
64
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
65
65
|
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
66
66
|
|
|
67
67
|
return df
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import sempy.fabric as fabric
|
|
2
1
|
from typing import Optional, List, Union, Tuple
|
|
3
2
|
from uuid import UUID
|
|
4
3
|
import sempy_labs._icons as icons
|
|
5
|
-
from
|
|
4
|
+
from .._helper_functions import (
|
|
6
5
|
_is_valid_uuid,
|
|
7
6
|
_build_url,
|
|
8
7
|
_update_dataframe_datatypes,
|
sempy_labs/admin/_capacities.py
CHANGED
|
@@ -3,7 +3,7 @@ from uuid import UUID
|
|
|
3
3
|
import sempy_labs._icons as icons
|
|
4
4
|
from typing import Optional, Tuple
|
|
5
5
|
from sempy._utils._log import log
|
|
6
|
-
from
|
|
6
|
+
from .._helper_functions import (
|
|
7
7
|
_base_api,
|
|
8
8
|
_build_url,
|
|
9
9
|
_create_dataframe,
|
|
@@ -106,21 +106,22 @@ def _list_capacities_meta() -> pd.DataFrame:
|
|
|
106
106
|
request="/v1.0/myorg/admin/capacities", client="fabric_sp", uses_pagination=True
|
|
107
107
|
)
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
rows = []
|
|
110
110
|
for r in responses:
|
|
111
111
|
for i in r.get("value", []):
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
rows.append(
|
|
113
|
+
{
|
|
114
|
+
"Capacity Id": i.get("id").lower(),
|
|
115
|
+
"Capacity Name": i.get("displayName"),
|
|
116
|
+
"Sku": i.get("sku"),
|
|
117
|
+
"Region": i.get("region"),
|
|
118
|
+
"State": i.get("state"),
|
|
119
|
+
"Admins": [i.get("admins", [])],
|
|
120
|
+
}
|
|
121
|
+
)
|
|
121
122
|
|
|
122
|
-
if
|
|
123
|
-
df = pd.
|
|
123
|
+
if rows:
|
|
124
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
124
125
|
|
|
125
126
|
return df
|
|
126
127
|
|
|
@@ -258,21 +259,22 @@ def list_capacities(
|
|
|
258
259
|
request="/v1.0/myorg/admin/capacities", client="fabric_sp", uses_pagination=True
|
|
259
260
|
)
|
|
260
261
|
|
|
261
|
-
|
|
262
|
+
rows = []
|
|
262
263
|
for r in responses:
|
|
263
264
|
for i in r.get("value", []):
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
265
|
+
rows.append(
|
|
266
|
+
{
|
|
267
|
+
"Capacity Id": i.get("id").lower(),
|
|
268
|
+
"Capacity Name": i.get("displayName"),
|
|
269
|
+
"Sku": i.get("sku"),
|
|
270
|
+
"Region": i.get("region"),
|
|
271
|
+
"State": i.get("state"),
|
|
272
|
+
"Admins": [i.get("admins", [])],
|
|
273
|
+
}
|
|
274
|
+
)
|
|
273
275
|
|
|
274
|
-
if
|
|
275
|
-
df = pd.
|
|
276
|
+
if rows:
|
|
277
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
276
278
|
|
|
277
279
|
if capacity is not None:
|
|
278
280
|
if _is_valid_uuid(capacity):
|
|
@@ -322,22 +324,23 @@ def list_capacity_users(capacity: str | UUID) -> pd.DataFrame:
|
|
|
322
324
|
request=f"/v1.0/myorg/admin/capacities/{capacity_id}/users", client="fabric_sp"
|
|
323
325
|
)
|
|
324
326
|
|
|
325
|
-
|
|
327
|
+
rows = []
|
|
326
328
|
for v in response.json().get("value", []):
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
329
|
+
rows.append(
|
|
330
|
+
{
|
|
331
|
+
"User Name": v.get("displayName"),
|
|
332
|
+
"Email Address": v.get("emailAddress"),
|
|
333
|
+
"Capacity User Access Right": v.get("capacityUserAccessRight"),
|
|
334
|
+
"Identifier": v.get("identifier"),
|
|
335
|
+
"Graph Id": v.get("graphId"),
|
|
336
|
+
"Principal Type": v.get("principalType"),
|
|
337
|
+
"User Type": v.get("userType"),
|
|
338
|
+
"Profile": v.get("profile"),
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
if rows:
|
|
343
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
341
344
|
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
342
345
|
|
|
343
346
|
return df
|
|
@@ -434,51 +437,50 @@ def get_refreshables(
|
|
|
434
437
|
|
|
435
438
|
responses = _base_api(request=url, client="fabric_sp")
|
|
436
439
|
|
|
437
|
-
|
|
438
|
-
|
|
440
|
+
rows = []
|
|
439
441
|
for i in responses.json().get("value", []):
|
|
440
442
|
last_refresh = i.get("lastRefresh", {})
|
|
441
443
|
refresh_schedule = i.get("refreshSchedule", {})
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
"
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
if
|
|
481
|
-
df = pd.DataFrame(
|
|
444
|
+
rows.append(
|
|
445
|
+
{
|
|
446
|
+
"Workspace Id": i.get("group", {}).get("id"),
|
|
447
|
+
"Workspace Name": i.get("group", {}).get("name"),
|
|
448
|
+
"Item Id": i.get("id"),
|
|
449
|
+
"Item Name": i.get("name"),
|
|
450
|
+
"Item Kind": i.get("kind"),
|
|
451
|
+
"Capacity Id": (
|
|
452
|
+
i.get("capacity", {}).get("id").lower()
|
|
453
|
+
if i.get("capacity", {}).get("id")
|
|
454
|
+
else None
|
|
455
|
+
),
|
|
456
|
+
"Capacity Name": i.get("capacity", {}).get("displayName"),
|
|
457
|
+
"Capacity SKU": i.get("capacity", {}).get("sku"),
|
|
458
|
+
"Refresh Count": i.get("refreshCount", 0),
|
|
459
|
+
"Refresh Failures": i.get("refreshFailures", 0),
|
|
460
|
+
"Average Duration": i.get("averageDuration", 0),
|
|
461
|
+
"Median Duration": i.get("medianDuration", 0),
|
|
462
|
+
"Refreshes Per Day": i.get("refreshesPerDay", 0),
|
|
463
|
+
"Refresh Type": last_refresh.get("refreshType"),
|
|
464
|
+
"Start Time": last_refresh.get("startTime"),
|
|
465
|
+
"End Time": last_refresh.get("endTime"),
|
|
466
|
+
"Status": last_refresh.get("status"),
|
|
467
|
+
"Request Id": last_refresh.get("requestId"),
|
|
468
|
+
"Service Exception Json": last_refresh.get("serviceExceptionJson"),
|
|
469
|
+
"Extended Status": last_refresh.get("extendedStatus"),
|
|
470
|
+
"Refresh Attempts": last_refresh.get("refreshAttempts"),
|
|
471
|
+
"Refresh Schedule Days": refresh_schedule.get("days"),
|
|
472
|
+
"Refresh Schedule Times": refresh_schedule.get("times"),
|
|
473
|
+
"Refresh Schedule Enabled": refresh_schedule.get("enabled"),
|
|
474
|
+
"Refresh Schedule Local Timezone Id": refresh_schedule.get(
|
|
475
|
+
"localTimeZoneId"
|
|
476
|
+
),
|
|
477
|
+
"Refresh Schedule Notify Option": refresh_schedule.get("notifyOption"),
|
|
478
|
+
"Configured By": i.get("configuredBy"),
|
|
479
|
+
}
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
if rows:
|
|
483
|
+
df = pd.DataFrame(rows, columns=list(columns.keys()))
|
|
482
484
|
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
483
485
|
|
|
484
486
|
return df
|
sempy_labs/admin/_dataflows.py
CHANGED