semantic-link-labs 0.8.10__py3-none-any.whl → 0.8.11__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.

Files changed (73) hide show
  1. {semantic_link_labs-0.8.10.dist-info → semantic_link_labs-0.8.11.dist-info}/METADATA +3 -2
  2. {semantic_link_labs-0.8.10.dist-info → semantic_link_labs-0.8.11.dist-info}/RECORD +73 -72
  3. sempy_labs/__init__.py +6 -2
  4. sempy_labs/_clear_cache.py +39 -37
  5. sempy_labs/_connections.py +13 -13
  6. sempy_labs/_data_pipelines.py +20 -20
  7. sempy_labs/_dataflows.py +27 -28
  8. sempy_labs/_dax.py +41 -47
  9. sempy_labs/_environments.py +26 -23
  10. sempy_labs/_eventhouses.py +16 -15
  11. sempy_labs/_eventstreams.py +16 -15
  12. sempy_labs/_external_data_shares.py +18 -20
  13. sempy_labs/_gateways.py +14 -14
  14. sempy_labs/_generate_semantic_model.py +99 -62
  15. sempy_labs/_git.py +105 -43
  16. sempy_labs/_helper_functions.py +148 -131
  17. sempy_labs/_job_scheduler.py +92 -0
  18. sempy_labs/_kql_databases.py +16 -15
  19. sempy_labs/_kql_querysets.py +16 -15
  20. sempy_labs/_list_functions.py +114 -99
  21. sempy_labs/_managed_private_endpoints.py +19 -17
  22. sempy_labs/_mirrored_databases.py +51 -48
  23. sempy_labs/_mirrored_warehouses.py +5 -4
  24. sempy_labs/_ml_experiments.py +16 -15
  25. sempy_labs/_ml_models.py +15 -14
  26. sempy_labs/_model_bpa.py +3 -3
  27. sempy_labs/_model_dependencies.py +55 -29
  28. sempy_labs/_notebooks.py +27 -25
  29. sempy_labs/_one_lake_integration.py +23 -26
  30. sempy_labs/_query_scale_out.py +67 -64
  31. sempy_labs/_refresh_semantic_model.py +25 -26
  32. sempy_labs/_spark.py +33 -32
  33. sempy_labs/_sql.py +12 -9
  34. sempy_labs/_translations.py +10 -7
  35. sempy_labs/_vertipaq.py +34 -31
  36. sempy_labs/_warehouses.py +22 -21
  37. sempy_labs/_workspace_identity.py +11 -10
  38. sempy_labs/_workspaces.py +40 -33
  39. sempy_labs/admin/_basic_functions.py +10 -12
  40. sempy_labs/admin/_external_data_share.py +3 -3
  41. sempy_labs/admin/_items.py +4 -4
  42. sempy_labs/admin/_scanner.py +3 -1
  43. sempy_labs/directlake/_directlake_schema_compare.py +18 -14
  44. sempy_labs/directlake/_directlake_schema_sync.py +18 -12
  45. sempy_labs/directlake/_dl_helper.py +25 -26
  46. sempy_labs/directlake/_generate_shared_expression.py +10 -9
  47. sempy_labs/directlake/_get_directlake_lakehouse.py +16 -13
  48. sempy_labs/directlake/_get_shared_expression.py +4 -3
  49. sempy_labs/directlake/_guardrails.py +12 -6
  50. sempy_labs/directlake/_list_directlake_model_calc_tables.py +15 -9
  51. sempy_labs/directlake/_show_unsupported_directlake_objects.py +16 -10
  52. sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py +35 -31
  53. sempy_labs/directlake/_update_directlake_partition_entity.py +34 -31
  54. sempy_labs/directlake/_warm_cache.py +87 -65
  55. sempy_labs/lakehouse/_get_lakehouse_columns.py +10 -8
  56. sempy_labs/lakehouse/_get_lakehouse_tables.py +10 -9
  57. sempy_labs/lakehouse/_lakehouse.py +17 -13
  58. sempy_labs/lakehouse/_shortcuts.py +42 -23
  59. sempy_labs/migration/_create_pqt_file.py +16 -11
  60. sempy_labs/migration/_refresh_calc_tables.py +16 -10
  61. sempy_labs/report/_download_report.py +9 -8
  62. sempy_labs/report/_generate_report.py +40 -44
  63. sempy_labs/report/_paginated.py +9 -9
  64. sempy_labs/report/_report_bpa.py +13 -9
  65. sempy_labs/report/_report_functions.py +80 -91
  66. sempy_labs/report/_report_helper.py +8 -4
  67. sempy_labs/report/_report_list_functions.py +24 -13
  68. sempy_labs/report/_report_rebind.py +17 -16
  69. sempy_labs/report/_reportwrapper.py +41 -33
  70. sempy_labs/tom/_model.py +43 -6
  71. {semantic_link_labs-0.8.10.dist-info → semantic_link_labs-0.8.11.dist-info}/LICENSE +0 -0
  72. {semantic_link_labs-0.8.10.dist-info → semantic_link_labs-0.8.11.dist-info}/WHEEL +0 -0
  73. {semantic_link_labs-0.8.10.dist-info → semantic_link_labs-0.8.11.dist-info}/top_level.txt +0 -0
@@ -8,10 +8,11 @@ from sempy_labs._helper_functions import (
8
8
  pagination,
9
9
  )
10
10
  from sempy.fabric.exceptions import FabricHTTPException
11
+ from uuid import UUID
11
12
 
12
13
 
13
14
  def create_eventhouse(
14
- name: str, description: Optional[str] = None, workspace: Optional[str] = None
15
+ name: str, description: Optional[str] = None, workspace: Optional[str | UUID] = None
15
16
  ):
16
17
  """
17
18
  Creates a Fabric eventhouse.
@@ -24,13 +25,13 @@ def create_eventhouse(
24
25
  Name of the eventhouse.
25
26
  description : str, default=None
26
27
  A description of the environment.
27
- workspace : str, default=None
28
- The Fabric workspace name.
28
+ workspace : str | uuid.UUID, default=None
29
+ The Fabric workspace name or ID.
29
30
  Defaults to None which resolves to the workspace of the attached lakehouse
30
31
  or if no lakehouse attached, resolves to the workspace of the notebook.
31
32
  """
32
33
 
33
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
34
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
34
35
 
35
36
  request_body = {"displayName": name}
36
37
 
@@ -45,11 +46,11 @@ def create_eventhouse(
45
46
  lro(client, response, status_codes=[201, 202])
46
47
 
47
48
  print(
48
- f"{icons.green_dot} The '{name}' eventhouse has been created within the '{workspace}' workspace."
49
+ f"{icons.green_dot} The '{name}' eventhouse has been created within the '{workspace_name}' workspace."
49
50
  )
50
51
 
51
52
 
52
- def list_eventhouses(workspace: Optional[str] = None) -> pd.DataFrame:
53
+ def list_eventhouses(workspace: Optional[str | UUID] = None) -> pd.DataFrame:
53
54
  """
54
55
  Shows the eventhouses within a workspace.
55
56
 
@@ -57,8 +58,8 @@ def list_eventhouses(workspace: Optional[str] = None) -> pd.DataFrame:
57
58
 
58
59
  Parameters
59
60
  ----------
60
- workspace : str, default=None
61
- The Fabric workspace name.
61
+ workspace : str | uuid.UUID, default=None
62
+ The Fabric workspace name or ID.
62
63
  Defaults to None which resolves to the workspace of the attached lakehouse
63
64
  or if no lakehouse attached, resolves to the workspace of the notebook.
64
65
 
@@ -70,7 +71,7 @@ def list_eventhouses(workspace: Optional[str] = None) -> pd.DataFrame:
70
71
 
71
72
  df = pd.DataFrame(columns=["Eventhouse Name", "Eventhouse Id", "Description"])
72
73
 
73
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
74
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
74
75
 
75
76
  client = fabric.FabricRestClient()
76
77
  response = client.get(f"/v1/workspaces/{workspace_id}/eventhouses")
@@ -91,7 +92,7 @@ def list_eventhouses(workspace: Optional[str] = None) -> pd.DataFrame:
91
92
  return df
92
93
 
93
94
 
94
- def delete_eventhouse(name: str, workspace: Optional[str] = None):
95
+ def delete_eventhouse(name: str, workspace: Optional[str | UUID] = None):
95
96
  """
96
97
  Deletes a Fabric eventhouse.
97
98
 
@@ -101,16 +102,16 @@ def delete_eventhouse(name: str, workspace: Optional[str] = None):
101
102
  ----------
102
103
  name: str
103
104
  Name of the eventhouse.
104
- workspace : str, default=None
105
- The Fabric workspace name.
105
+ workspace : str | uuid.UUID, default=None
106
+ The Fabric workspace name or ID.
106
107
  Defaults to None which resolves to the workspace of the attached lakehouse
107
108
  or if no lakehouse attached, resolves to the workspace of the notebook.
108
109
  """
109
110
 
110
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
111
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
111
112
 
112
113
  item_id = fabric.resolve_item_id(
113
- item_name=name, type="Eventhouse", workspace=workspace
114
+ item_name=name, type="Eventhouse", workspace=workspace_id
114
115
  )
115
116
 
116
117
  client = fabric.FabricRestClient()
@@ -120,5 +121,5 @@ def delete_eventhouse(name: str, workspace: Optional[str] = None):
120
121
  raise FabricHTTPException(response)
121
122
 
122
123
  print(
123
- f"{icons.green_dot} The '{name}' eventhouse within the '{workspace}' workspace has been deleted."
124
+ f"{icons.green_dot} The '{name}' eventhouse within the '{workspace_name}' workspace has been deleted."
124
125
  )
@@ -8,9 +8,10 @@ from sempy_labs._helper_functions import (
8
8
  pagination,
9
9
  )
10
10
  from sempy.fabric.exceptions import FabricHTTPException
11
+ from uuid import UUID
11
12
 
12
13
 
13
- def list_eventstreams(workspace: Optional[str] = None) -> pd.DataFrame:
14
+ def list_eventstreams(workspace: Optional[str | UUID] = None) -> pd.DataFrame:
14
15
  """
15
16
  Shows the eventstreams within a workspace.
16
17
 
@@ -18,8 +19,8 @@ def list_eventstreams(workspace: Optional[str] = None) -> pd.DataFrame:
18
19
 
19
20
  Parameters
20
21
  ----------
21
- workspace : str, default=None
22
- The Fabric workspace name.
22
+ workspace : str | uuid.UUID, default=None
23
+ The Fabric workspace name or ID.
23
24
  Defaults to None which resolves to the workspace of the attached lakehouse
24
25
  or if no lakehouse attached, resolves to the workspace of the notebook.
25
26
 
@@ -31,7 +32,7 @@ def list_eventstreams(workspace: Optional[str] = None) -> pd.DataFrame:
31
32
 
32
33
  df = pd.DataFrame(columns=["Eventstream Name", "Eventstream Id", "Description"])
33
34
 
34
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
35
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
35
36
 
36
37
  client = fabric.FabricRestClient()
37
38
  response = client.get(f"/v1/workspaces/{workspace_id}/eventstreams")
@@ -53,7 +54,7 @@ def list_eventstreams(workspace: Optional[str] = None) -> pd.DataFrame:
53
54
 
54
55
 
55
56
  def create_eventstream(
56
- name: str, description: Optional[str] = None, workspace: Optional[str] = None
57
+ name: str, description: Optional[str] = None, workspace: Optional[str | UUID] = None
57
58
  ):
58
59
  """
59
60
  Creates a Fabric eventstream.
@@ -66,13 +67,13 @@ def create_eventstream(
66
67
  Name of the eventstream.
67
68
  description : str, default=None
68
69
  A description of the environment.
69
- workspace : str, default=None
70
- The Fabric workspace name.
70
+ workspace : str | uuid.UUID, default=None
71
+ The Fabric workspace name or ID.
71
72
  Defaults to None which resolves to the workspace of the attached lakehouse
72
73
  or if no lakehouse attached, resolves to the workspace of the notebook.
73
74
  """
74
75
 
75
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
76
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
76
77
 
77
78
  request_body = {"displayName": name}
78
79
 
@@ -87,11 +88,11 @@ def create_eventstream(
87
88
  lro(client, response, status_codes=[201, 202])
88
89
 
89
90
  print(
90
- f"{icons.green_dot} The '{name}' eventstream has been created within the '{workspace}' workspace."
91
+ f"{icons.green_dot} The '{name}' eventstream has been created within the '{workspace_name}' workspace."
91
92
  )
92
93
 
93
94
 
94
- def delete_eventstream(name: str, workspace: Optional[str] = None):
95
+ def delete_eventstream(name: str, workspace: Optional[str | UUID] = None):
95
96
  """
96
97
  Deletes a Fabric eventstream.
97
98
 
@@ -101,16 +102,16 @@ def delete_eventstream(name: str, workspace: Optional[str] = None):
101
102
  ----------
102
103
  name: str
103
104
  Name of the eventstream.
104
- workspace : str, default=None
105
- The Fabric workspace name.
105
+ workspace : str | uuid.UUID, default=None
106
+ The Fabric workspace name or ID.
106
107
  Defaults to None which resolves to the workspace of the attached lakehouse
107
108
  or if no lakehouse attached, resolves to the workspace of the notebook.
108
109
  """
109
110
 
110
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
111
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
111
112
 
112
113
  item_id = fabric.resolve_item_id(
113
- item_name=name, type="Eventstream", workspace=workspace
114
+ item_name=name, type="Eventstream", workspace=workspace_id
114
115
  )
115
116
 
116
117
  client = fabric.FabricRestClient()
@@ -120,5 +121,5 @@ def delete_eventstream(name: str, workspace: Optional[str] = None):
120
121
  raise FabricHTTPException(response)
121
122
 
122
123
  print(
123
- f"{icons.green_dot} The '{name}' eventstream within the '{workspace}' workspace has been deleted."
124
+ f"{icons.green_dot} The '{name}' eventstream within the '{workspace_name}' workspace has been deleted."
124
125
  )
@@ -15,7 +15,7 @@ def create_external_data_share(
15
15
  item_type: str,
16
16
  paths: str | List[str],
17
17
  recipient: str,
18
- workspace: Optional[str] = None,
18
+ workspace: Optional[str | UUID] = None,
19
19
  ):
20
20
  """
21
21
  Creates an external data share for a given path or list of paths in the specified item.
@@ -32,17 +32,15 @@ def create_external_data_share(
32
32
  The path or list of paths that are to be externally shared. Currently, only a single path is supported.
33
33
  recipient : str
34
34
  The email address of the recipient.
35
- workspace : str, default=None
36
- The Fabric workspace name.
35
+ workspace : str | uuid.UUID, default=None
36
+ The Fabric workspace name or ID.
37
37
  Defaults to None which resolves to the workspace of the attached lakehouse
38
38
  or if no lakehouse attached, resolves to the workspace of the notebook.
39
39
  """
40
40
 
41
- # https://learn.microsoft.com/en-us/rest/api/fabric/core/external-data-shares/create-external-data-share?tabs=HTTP
42
-
43
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
41
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
44
42
  item_id = fabric.resolve_item_id(
45
- item_name=item_name, type=item_type, workspace=workspace
43
+ item_name=item_name, type=item_type, workspace=workspace_id
46
44
  )
47
45
 
48
46
  if isinstance(paths, str):
@@ -60,7 +58,7 @@ def create_external_data_share(
60
58
  raise FabricHTTPException(response)
61
59
 
62
60
  print(
63
- f"{icons.green_dot} An external data share was created for the '{item_name}' {item_type} within the '{workspace}' workspace for the {paths} paths."
61
+ f"{icons.green_dot} An external data share was created for the '{item_name}' {item_type} within the '{workspace_name}' workspace for the {paths} paths."
64
62
  )
65
63
 
66
64
 
@@ -68,7 +66,7 @@ def revoke_external_data_share(
68
66
  external_data_share_id: UUID,
69
67
  item_name: str,
70
68
  item_type: str,
71
- workspace: Optional[str] = None,
69
+ workspace: Optional[str | UUID] = None,
72
70
  ):
73
71
  """
74
72
  Revokes the specified external data share. Note: This action cannot be undone.
@@ -77,21 +75,21 @@ def revoke_external_data_share(
77
75
 
78
76
  Parameters
79
77
  ----------
80
- external_data_share_id : UUID
78
+ external_data_share_id : uuid.UUID
81
79
  The external data share ID.
82
80
  item_name : str
83
81
  The item name.
84
82
  item_type : str
85
83
  The `item type <https://learn.microsoft.com/rest/api/fabric/core/items/list-items?tabs=HTTP#itemtype>`_.
86
- workspace : str, default=None
87
- The Fabric workspace name.
84
+ workspace : str | uuid.UUID, default=None
85
+ The Fabric workspace name or ID.
88
86
  Defaults to None which resolves to the workspace of the attached lakehouse
89
87
  or if no lakehouse attached, resolves to the workspace of the notebook.
90
88
  """
91
89
 
92
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
90
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
93
91
  item_id = fabric.resolve_item_id(
94
- item_name=item_name, type=item_type, workspace=workspace
92
+ item_name=item_name, type=item_type, workspace=workspace_id
95
93
  )
96
94
 
97
95
  client = fabric.FabricRestClient()
@@ -103,12 +101,12 @@ def revoke_external_data_share(
103
101
  raise FabricHTTPException(response)
104
102
 
105
103
  print(
106
- f"{icons.green_dot} The '{external_data_share_id}' external data share for the '{item_name}' {item_type} within the '{workspace}' workspace has been revoked."
104
+ f"{icons.green_dot} The '{external_data_share_id}' external data share for the '{item_name}' {item_type} within the '{workspace_name}' workspace has been revoked."
107
105
  )
108
106
 
109
107
 
110
108
  def list_external_data_shares_in_item(
111
- item_name: str, item_type: str, workspace: Optional[str] = None
109
+ item_name: str, item_type: str, workspace: Optional[str | UUID] = None
112
110
  ) -> pd.DataFrame:
113
111
  """
114
112
  Returns a list of the external data shares that exist for the specified item.
@@ -121,8 +119,8 @@ def list_external_data_shares_in_item(
121
119
  The item name.
122
120
  item_type : str
123
121
  The `item type <https://learn.microsoft.com/rest/api/fabric/core/items/list-items?tabs=HTTP#itemtype>`_.
124
- workspace : str, default=None
125
- The Fabric workspace name.
122
+ workspace : str | uuid.UUID, default=None
123
+ The Fabric workspace name or ID.
126
124
  Defaults to None which resolves to the workspace of the attached lakehouse
127
125
  or if no lakehouse attached, resolves to the workspace of the notebook.
128
126
 
@@ -132,9 +130,9 @@ def list_external_data_shares_in_item(
132
130
  A pandas dataframe showing a list of the external data shares that exist for the specified item.
133
131
  """
134
132
 
135
- (workspace, workspace_id) = resolve_workspace_name_and_id(workspace)
133
+ (workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
136
134
  item_id = fabric.resolve_item_id(
137
- item_name=item_name, type=item_type, workspace=workspace
135
+ item_name=item_name, type=item_type, workspace=workspace_id
138
136
  )
139
137
 
140
138
  client = fabric.FabricRestClient()
sempy_labs/_gateways.py CHANGED
@@ -95,7 +95,7 @@ def delete_gateway(gateway: str | UUID):
95
95
 
96
96
  Parameters
97
97
  ----------
98
- gateway : str | UUID
98
+ gateway : str | uuid.UUID
99
99
  The gateway name or ID.
100
100
  """
101
101
 
@@ -117,7 +117,7 @@ def list_gateway_role_assigments(gateway: str | UUID) -> pd.DataFrame:
117
117
 
118
118
  Parameters
119
119
  ----------
120
- gateway : str | UUID
120
+ gateway : str | uuid.UUID
121
121
  The gateway name or ID.
122
122
 
123
123
  Returns
@@ -159,9 +159,9 @@ def delete_gateway_role_assignment(gateway: str | UUID, role_assignement_id: UUI
159
159
 
160
160
  Parameters
161
161
  ----------
162
- gateway : str | UUID
162
+ gateway : str | uuid.UUID
163
163
  The gateway name or ID.
164
- role_assignement_id : UUID
164
+ role_assignement_id : uuid.UUID
165
165
  The role assignment ID.
166
166
  """
167
167
 
@@ -204,9 +204,9 @@ def delete_gateway_member(gateway: str | UUID, gateway_member: str | UUID):
204
204
 
205
205
  Parameters
206
206
  ----------
207
- gateway : str | UUID
207
+ gateway : str | uuid.UUID
208
208
  The gateway name or ID.
209
- gateway_member : str | UUID
209
+ gateway_member : str | uuid.UUID
210
210
  The gateway member name or ID.
211
211
  """
212
212
 
@@ -234,7 +234,7 @@ def list_gateway_members(gateway: str | UUID) -> pd.DataFrame:
234
234
 
235
235
  Parameters
236
236
  ----------
237
- gateway : str | UUID
237
+ gateway : str | uuid.UUID
238
238
  The gateway name or ID.
239
239
 
240
240
  Returns
@@ -298,7 +298,7 @@ def create_vnet_gateway(
298
298
  ----------
299
299
  name : str
300
300
  The gateway name.
301
- capacity : str | UUID
301
+ capacity : str | uuid.UUID
302
302
  The capacity name or Id.
303
303
  inactivity_minutes_before_sleep : int
304
304
  The minutes of inactivity before the virtual network gateway goes into auto-sleep. Must be one of the following values: 30, 60, 90, 120, 150, 240, 360, 480, 720, 1440.
@@ -353,7 +353,7 @@ def update_on_premises_gateway(
353
353
 
354
354
  Parameters
355
355
  ----------
356
- gateway : str | UUID
356
+ gateway : str | uuid.UUID
357
357
  The gateway name or ID.
358
358
  allow_cloud_connection_refresh : bool, default=None
359
359
  Whether to allow cloud connections to refresh through this on-premises gateway. True - Allow, False - Do not allow.
@@ -403,9 +403,9 @@ def update_vnet_gateway(
403
403
 
404
404
  Parameters
405
405
  ----------
406
- gateway : str | UUID
406
+ gateway : str | uuid.UUID
407
407
  The gateway name or ID.
408
- capacity: str | UUID
408
+ capacity: str | uuid.UUID
409
409
  The capacity name or ID.
410
410
  inactivity_minutes_before_sleep : int, default=None
411
411
  The minutes of inactivity before the virtual network gateway goes into auto-sleep. Must be one of the following values: 30, 60, 90, 120, 150, 240, 360, 480, 720, 1440.
@@ -451,11 +451,11 @@ def bind_semantic_model_to_gateway(
451
451
 
452
452
  Parameters
453
453
  ----------
454
- dataset : str | UUID
454
+ dataset : str | uuid.UUID
455
455
  The name or ID of the semantic model.
456
- gateway : str | UUID
456
+ gateway : str | uuid.UUID
457
457
  The name or ID of the gateway.
458
- workspace : str | UUID, default=None
458
+ workspace : str | uuid.UUID, default=None
459
459
  The Fabric workspace name.
460
460
  Defaults to None which resolves to the workspace of the attached lakehouse
461
461
  or if no lakehouse attached, resolves to the workspace of the notebook.