You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sempy_labs/_generate_semantic_model.py
+73-18Lines changed: 73 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
importpandasaspd
3
3
importjson
4
4
importos
5
-
fromtypingimportOptional
5
+
fromtypingimportOptional, List
6
6
fromsempy_labs._helper_functionsimport (
7
7
resolve_lakehouse_name,
8
8
resolve_workspace_name_and_id,
@@ -329,8 +329,6 @@ def get_semantic_model_bim(
329
329
"""
330
330
Extracts the Model.bim file for a given semantic model.
331
331
332
-
This is a wrapper function for the following API: `Items - Get Semantic Model Definition <https://learn.microsoft.com/rest/api/fabric/semanticmodel/items/get-semantic-model-definition>`_.
f"{icons.green_dot} The .bim file for the '{dataset}' semantic model has been saved to the '{lakehouse}' in this location: '{filePath}'.\n\n"
372
+
f"{icons.green_dot} The {fileExt} file for the '{dataset}' semantic model has been saved to the '{lakehouse}' in this location: '{filePath}'.\n\n"
388
373
)
389
374
390
375
returnbimJson
391
376
392
377
378
+
defget_semantic_model_definition(
379
+
dataset: str,
380
+
format: str="TMSL",
381
+
workspace: Optional[str] =None,
382
+
return_dataframe: bool=True,
383
+
) ->pd.DataFrame|dict|List:
384
+
"""
385
+
Extracts the semantic model definition.
386
+
387
+
This is a wrapper function for the following API: `Items - Get Semantic Model Definition <https://learn.microsoft.com/rest/api/fabric/semanticmodel/items/get-semantic-model-definition>`_.
388
+
389
+
Parameters
390
+
----------
391
+
dataset : str
392
+
Name of the semantic model.
393
+
format : str, default="TMSL"
394
+
The output format. Valid options are "TMSL" or "TMDL". "TMSL" returns the .bim file whereas "TMDL" returns the collection of TMDL files. Can also enter 'bim' for the TMSL version.
395
+
workspace : str, default=None
396
+
The Fabric workspace name in which the semantic model resides.
397
+
Defaults to None which resolves to the workspace of the attached lakehouse
398
+
or if no lakehouse attached, resolves to the workspace of the notebook.
399
+
return_dataframe : bool, default=True
400
+
If True, returns a dataframe.
401
+
If False, returns the .bim file for TMSL format. Returns a list of the TMDL files (decoded) for TMDL format.
402
+
403
+
Returns
404
+
-------
405
+
pandas.DataFrame | dict | List
406
+
A pandas dataframe with the semantic model definition or the file or files comprising the semantic model definition.
Copy file name to clipboardExpand all lines: src/sempy_labs/admin/_basic_functions.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -126,7 +126,7 @@ def list_capacities(
126
126
capacity: Optional[str|UUID] =None,
127
127
) ->pd.DataFrame:
128
128
"""
129
-
Shows the a list of capacities and their properties. This function is the admin version.
129
+
Shows the a list of capacities and their properties.
130
130
131
131
This is a wrapper function for the following API: `Admin - Get Capacities As Admin <https://learn.microsoft.com/rest/api/power-bi/admin/get-capacities-as-admin>`_.
132
132
@@ -138,7 +138,7 @@ def list_capacities(
138
138
Returns
139
139
-------
140
140
pandas.DataFrame
141
-
A pandas dataframe showing the capacities and their properties
141
+
A pandas dataframe showing the capacities and their properties.
0 commit comments