semantic-link-labs 0.8.9__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.
- {semantic_link_labs-0.8.9.dist-info → semantic_link_labs-0.8.11.dist-info}/METADATA +5 -2
- {semantic_link_labs-0.8.9.dist-info → semantic_link_labs-0.8.11.dist-info}/RECORD +76 -75
- sempy_labs/__init__.py +14 -2
- sempy_labs/_authentication.py +31 -2
- sempy_labs/_clear_cache.py +39 -37
- sempy_labs/_connections.py +13 -13
- sempy_labs/_data_pipelines.py +20 -20
- sempy_labs/_dataflows.py +27 -28
- sempy_labs/_dax.py +41 -47
- sempy_labs/_environments.py +26 -23
- sempy_labs/_eventhouses.py +16 -15
- sempy_labs/_eventstreams.py +16 -15
- sempy_labs/_external_data_shares.py +18 -20
- sempy_labs/_gateways.py +57 -11
- sempy_labs/_generate_semantic_model.py +100 -71
- sempy_labs/_git.py +134 -67
- sempy_labs/_helper_functions.py +199 -145
- sempy_labs/_job_scheduler.py +92 -0
- sempy_labs/_kql_databases.py +16 -15
- sempy_labs/_kql_querysets.py +16 -15
- sempy_labs/_list_functions.py +281 -120
- sempy_labs/_managed_private_endpoints.py +19 -17
- sempy_labs/_mirrored_databases.py +51 -48
- sempy_labs/_mirrored_warehouses.py +5 -4
- sempy_labs/_ml_experiments.py +16 -15
- sempy_labs/_ml_models.py +15 -14
- sempy_labs/_model_bpa.py +27 -25
- sempy_labs/_model_bpa_bulk.py +3 -3
- sempy_labs/_model_dependencies.py +60 -28
- sempy_labs/_notebooks.py +73 -39
- sempy_labs/_one_lake_integration.py +23 -26
- sempy_labs/_query_scale_out.py +67 -64
- sempy_labs/_refresh_semantic_model.py +47 -42
- sempy_labs/_spark.py +33 -32
- sempy_labs/_sql.py +12 -9
- sempy_labs/_translations.py +10 -7
- sempy_labs/_vertipaq.py +34 -31
- sempy_labs/_warehouses.py +22 -21
- sempy_labs/_workspace_identity.py +11 -10
- sempy_labs/_workspaces.py +40 -33
- sempy_labs/admin/__init__.py +4 -0
- sempy_labs/admin/_basic_functions.py +44 -12
- sempy_labs/admin/_external_data_share.py +3 -3
- sempy_labs/admin/_items.py +4 -4
- sempy_labs/admin/_scanner.py +7 -5
- sempy_labs/directlake/_directlake_schema_compare.py +18 -14
- sempy_labs/directlake/_directlake_schema_sync.py +18 -12
- sempy_labs/directlake/_dl_helper.py +36 -32
- sempy_labs/directlake/_generate_shared_expression.py +10 -9
- sempy_labs/directlake/_get_directlake_lakehouse.py +16 -13
- sempy_labs/directlake/_get_shared_expression.py +4 -3
- sempy_labs/directlake/_guardrails.py +12 -6
- sempy_labs/directlake/_list_directlake_model_calc_tables.py +15 -9
- sempy_labs/directlake/_show_unsupported_directlake_objects.py +16 -10
- sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py +35 -31
- sempy_labs/directlake/_update_directlake_partition_entity.py +34 -31
- sempy_labs/directlake/_warm_cache.py +87 -65
- sempy_labs/lakehouse/_get_lakehouse_columns.py +10 -8
- sempy_labs/lakehouse/_get_lakehouse_tables.py +10 -9
- sempy_labs/lakehouse/_lakehouse.py +17 -13
- sempy_labs/lakehouse/_shortcuts.py +42 -23
- sempy_labs/migration/_create_pqt_file.py +16 -11
- sempy_labs/migration/_refresh_calc_tables.py +16 -10
- sempy_labs/report/_download_report.py +9 -8
- sempy_labs/report/_generate_report.py +40 -44
- sempy_labs/report/_paginated.py +9 -9
- sempy_labs/report/_report_bpa.py +13 -9
- sempy_labs/report/_report_functions.py +80 -91
- sempy_labs/report/_report_helper.py +8 -4
- sempy_labs/report/_report_list_functions.py +24 -13
- sempy_labs/report/_report_rebind.py +17 -16
- sempy_labs/report/_reportwrapper.py +41 -33
- sempy_labs/tom/_model.py +117 -38
- {semantic_link_labs-0.8.9.dist-info → semantic_link_labs-0.8.11.dist-info}/LICENSE +0 -0
- {semantic_link_labs-0.8.9.dist-info → semantic_link_labs-0.8.11.dist-info}/WHEEL +0 -0
- {semantic_link_labs-0.8.9.dist-info → semantic_link_labs-0.8.11.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: semantic-link-labs
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.11
|
|
4
4
|
Summary: Semantic Link Labs for Microsoft Fabric
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License: MIT License
|
|
@@ -27,7 +27,7 @@ Requires-Dist: pytest>=8.2.1; extra == "test"
|
|
|
27
27
|
# Semantic Link Labs
|
|
28
28
|
|
|
29
29
|
[](https://badge.fury.io/py/semantic-link-labs)
|
|
30
|
-
[](https://readthedocs.org/projects/semantic-link-labs/)
|
|
31
31
|
[](https://github.com/psf/black)
|
|
32
32
|
[](https://pepy.tech/project/semantic-link-labs)
|
|
33
33
|
|
|
@@ -64,6 +64,7 @@ Check out the video below for an introduction to Semantic Link, Semantic Link La
|
|
|
64
64
|
* [Dynamically generate a Direct Lake semantic model](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.directlake.html#sempy_labs.directlake.generate_direct_lake_semantic_model)
|
|
65
65
|
* [Check why a Direct Lake semantic model would fallback to DirectQuery](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.directlake.html#sempy_labs.directlake.check_fallback_reason)
|
|
66
66
|
* [View a measure dependency tree](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.measure_dependency_tree)
|
|
67
|
+
* [View unique columns touched in a single (or multiple) DAX query(ies)](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.get_dax_query_dependencies)
|
|
67
68
|
* Reports
|
|
68
69
|
* [Report Best Practice Analyzer (BPA)](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.report.html#sempy_labs.report.run_report_bpa)
|
|
69
70
|
* [View report metadata](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Report%20Analysis.ipynb)
|
|
@@ -141,6 +142,8 @@ An even better way to ensure the semantic-link-labs library is available in your
|
|
|
141
142
|
2. Select your newly created environment within the 'Environment' drop down in the navigation bar at the top of the notebook
|
|
142
143
|
|
|
143
144
|
## Version History
|
|
145
|
+
* [0.8.11](https://github.com/microsoft/semantic-link-labs/releases/tag/0.8.11) (December 19, 2024)
|
|
146
|
+
* [0.8.10](https://github.com/microsoft/semantic-link-labs/releases/tag/0.8.10) (December 16, 2024)
|
|
144
147
|
* [0.8.9](https://github.com/microsoft/semantic-link-labs/releases/tag/0.8.9) (December 4, 2024)
|
|
145
148
|
* [0.8.8](https://github.com/microsoft/semantic-link-labs/releases/tag/0.8.8) (November 28, 2024)
|
|
146
149
|
* [0.8.7](https://github.com/microsoft/semantic-link-labs/releases/tag/0.8.7) (November 27, 2024)
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
sempy_labs/__init__.py,sha256=
|
|
1
|
+
sempy_labs/__init__.py,sha256=tFS1eXuaSVb2pFpDI3tod4ei4OJsitxbZupbyME0Zxw,13271
|
|
2
2
|
sempy_labs/_ai.py,sha256=CzsNw6Wpd2B5Rd0RcY250-_p0L-0gFoMNLEc_KmrobU,16177
|
|
3
|
-
sempy_labs/_authentication.py,sha256=
|
|
3
|
+
sempy_labs/_authentication.py,sha256=a4sPN8IAf7w-Jftm3PvtF62HqWLkCD69tXgze_G59Zg,4642
|
|
4
4
|
sempy_labs/_capacities.py,sha256=HWX1ivlWpyS7Ea_ny-39kUAQYFGMzo42kWMGdJMINos,25466
|
|
5
5
|
sempy_labs/_capacity_migration.py,sha256=PCIodWXas9v7q93hqD2m8EanJHPJzke52jbCWOfnLZk,27764
|
|
6
|
-
sempy_labs/_clear_cache.py,sha256=
|
|
7
|
-
sempy_labs/_connections.py,sha256
|
|
8
|
-
sempy_labs/_data_pipelines.py,sha256=
|
|
9
|
-
sempy_labs/_dataflows.py,sha256=
|
|
10
|
-
sempy_labs/_dax.py,sha256=
|
|
6
|
+
sempy_labs/_clear_cache.py,sha256=gaHbumh26I0RDKwjWhmlKVN7uR3oRNiFNzD4PNXjqG0,12896
|
|
7
|
+
sempy_labs/_connections.py,sha256=l6iDJgB-ZGR7jhNHGlhM1__xRVciLNAyILWLo8IX5bs,17693
|
|
8
|
+
sempy_labs/_data_pipelines.py,sha256=1elajdbtNySi-XSqeshG6q9dVUsjNvb6lvVQqelpzoI,5754
|
|
9
|
+
sempy_labs/_dataflows.py,sha256=hchdtA4pIC4R7q0QOKkE5Lmef_HBfRftoRorvp8-rt4,8311
|
|
10
|
+
sempy_labs/_dax.py,sha256=64yaKbSUpoDnub7uKXsuznJ6u_0peN_RfAZJYEB6uPY,9302
|
|
11
11
|
sempy_labs/_deployment_pipelines.py,sha256=WBBQM85-3-MkXb5OmRPF6U83xLyhKSlYUyhRlkvcl4k,6027
|
|
12
12
|
sempy_labs/_documentation.py,sha256=yVA8VPEzx_fmljtcvSxtB7-BeupYsfdMXXjp6Fpnyo8,5007
|
|
13
|
-
sempy_labs/_environments.py,sha256=
|
|
14
|
-
sempy_labs/_eventhouses.py,sha256=
|
|
15
|
-
sempy_labs/_eventstreams.py,sha256=
|
|
16
|
-
sempy_labs/_external_data_shares.py,sha256=
|
|
17
|
-
sempy_labs/_gateways.py,sha256=
|
|
18
|
-
sempy_labs/_generate_semantic_model.py,sha256=
|
|
19
|
-
sempy_labs/_git.py,sha256=
|
|
20
|
-
sempy_labs/_helper_functions.py,sha256=
|
|
13
|
+
sempy_labs/_environments.py,sha256=m0bZNUWERS0zMwVbGaHhJBbugpmql89V_QuFx4n20BI,5574
|
|
14
|
+
sempy_labs/_eventhouses.py,sha256=cmGrvH2j7SnpOIiYiILBRpgUVeFq18vBhSOzLiMAMV4,4161
|
|
15
|
+
sempy_labs/_eventstreams.py,sha256=MNjeHQCfKQ99vxr9J42qDR85Kmg4D5x3on3irRxwViQ,4186
|
|
16
|
+
sempy_labs/_external_data_shares.py,sha256=lKuAoW2M3SkWo4Tp0isd3W_Ich473605odAJcrtBm-c,6793
|
|
17
|
+
sempy_labs/_gateways.py,sha256=CulZHryKIsjExrj1YcS1iH0PmNUbB5iXTVmOb_xF0yA,16298
|
|
18
|
+
sempy_labs/_generate_semantic_model.py,sha256=RUpdXgqE2kQGnAoTtipML03cIS7JIw3ijE46t-heMCI,18322
|
|
19
|
+
sempy_labs/_git.py,sha256=ZHIo5qnR9QbV1DVKayBSb0i9iBxthkEtfm4YMKbUwNo,15926
|
|
20
|
+
sempy_labs/_helper_functions.py,sha256=HVoWFypkpSZMBkwGmk0yvueHJfP7WoEIh7HzsKEw28Q,40518
|
|
21
21
|
sempy_labs/_icons.py,sha256=ez2dx_LCti71S_-eB6WYQ-kOMyiBL8ZJN12-ev5dcmA,3579
|
|
22
|
-
sempy_labs/
|
|
23
|
-
sempy_labs/
|
|
24
|
-
sempy_labs/
|
|
25
|
-
sempy_labs/
|
|
26
|
-
sempy_labs/
|
|
27
|
-
sempy_labs/
|
|
28
|
-
sempy_labs/
|
|
29
|
-
sempy_labs/
|
|
22
|
+
sempy_labs/_job_scheduler.py,sha256=a3URwhhLZMNz0oz3B2Vwkk_B3s6fN5dgkPxuh38XM20,2913
|
|
23
|
+
sempy_labs/_kql_databases.py,sha256=z4UmjkLPOoIspystiCqA-4inpK5jv6IGYf-DsEcihhg,4746
|
|
24
|
+
sempy_labs/_kql_querysets.py,sha256=csnvTKB3jtcf_tv6D6okY0k445DVNcSmN253y6dRZww,4282
|
|
25
|
+
sempy_labs/_list_functions.py,sha256=bgDWfyc7lgG7QrQdFwtScv6pGUw28yIxl5ZqfFmRhns,62369
|
|
26
|
+
sempy_labs/_managed_private_endpoints.py,sha256=Cbql3ppCfLiCPqAvaApXL2wmjDyyljdZwibMFNsYYCk,6299
|
|
27
|
+
sempy_labs/_mirrored_databases.py,sha256=vbgbezabeO1QvN20IEmLCgag_aPAHsozDJIpkRNAgRU,14704
|
|
28
|
+
sempy_labs/_mirrored_warehouses.py,sha256=Q4fyl3Ov753nS68uG99EHSc9MwgAwwI4DEuQmx5XNaM,1816
|
|
29
|
+
sempy_labs/_ml_experiments.py,sha256=_Lj_aJJbhWAWg98Q1NY77wmelq-h5jLkTSnfv-Xnhds,4321
|
|
30
|
+
sempy_labs/_ml_models.py,sha256=74ncPj0PcTSrCkMmx3aKFYtel9B-Bb6OdV0TbiVJrjc,4166
|
|
30
31
|
sempy_labs/_model_auto_build.py,sha256=PTQo3dufzLSFcQ5shFkmBWAVSdP7cTJgpUclrcXyNbg,5105
|
|
31
|
-
sempy_labs/_model_bpa.py,sha256=
|
|
32
|
-
sempy_labs/_model_bpa_bulk.py,sha256=
|
|
32
|
+
sempy_labs/_model_bpa.py,sha256=xx0scJho_-_O0wpGMKevj2tuTEqsQye5kwgOll10n5I,21801
|
|
33
|
+
sempy_labs/_model_bpa_bulk.py,sha256=jU-kaeUeE1Slz5HEh3lSbnILzj2tfzMwvaOqOQG16Wg,16027
|
|
33
34
|
sempy_labs/_model_bpa_rules.py,sha256=96_GkXQGhON-_uyUATgUibk4W9y7e9wl1QciUr96gIQ,45544
|
|
34
|
-
sempy_labs/_model_dependencies.py,sha256=
|
|
35
|
-
sempy_labs/_notebooks.py,sha256=
|
|
36
|
-
sempy_labs/_one_lake_integration.py,sha256=
|
|
37
|
-
sempy_labs/_query_scale_out.py,sha256=
|
|
38
|
-
sempy_labs/_refresh_semantic_model.py,sha256=
|
|
39
|
-
sempy_labs/_spark.py,sha256=
|
|
40
|
-
sempy_labs/_sql.py,sha256=
|
|
41
|
-
sempy_labs/_translations.py,sha256=
|
|
42
|
-
sempy_labs/_vertipaq.py,sha256=
|
|
43
|
-
sempy_labs/_warehouses.py,sha256=
|
|
35
|
+
sempy_labs/_model_dependencies.py,sha256=rMh5FWrVNNs5uHC1AWIH1MwhZ3lvpb08ECwNQ7-7zvs,13111
|
|
36
|
+
sempy_labs/_notebooks.py,sha256=XlHgiNcY02bO8mOLraBSGBY8e-MUp8gCxTdWOmBFgdY,8452
|
|
37
|
+
sempy_labs/_one_lake_integration.py,sha256=fnmM6MeiME5ks1Jd7r3tWYKSafU37Um90K6iDx5S5zg,6223
|
|
38
|
+
sempy_labs/_query_scale_out.py,sha256=VuNGGGuzD6KiVvU4QbvZsyQufxgD2tbwkNvd_avSfRw,16385
|
|
39
|
+
sempy_labs/_refresh_semantic_model.py,sha256=G6j1Pj9HBTRbJQ2UX_fxYzoBrzgUmlxy_7_eEijqLtc,17547
|
|
40
|
+
sempy_labs/_spark.py,sha256=txetwju75jz1mkQNY-QUscp0at7StDYHLpjvJ0-v7xQ,20340
|
|
41
|
+
sempy_labs/_sql.py,sha256=RAhO1-wbKAwjcYyfGbLh8osIUWecT8w_OiBQm9Nju4c,5366
|
|
42
|
+
sempy_labs/_translations.py,sha256=CxpfnyCmn6hAiImxTOvz6x1HG4ppZORHCemJogKPV-M,16193
|
|
43
|
+
sempy_labs/_vertipaq.py,sha256=TTMe0l2HYjVn03xhDsJrgzpVu_lPZKSrG1XecDxWJjw,37930
|
|
44
|
+
sempy_labs/_warehouses.py,sha256=lsKWbJfWVQKwrhe0S0dIZ9cTYFwAIdQytzBCRAiX5W8,7380
|
|
44
45
|
sempy_labs/_workloads.py,sha256=x3dS2mOkrS9rA-p70z8849DZlMIvMbzTjMzO_YmnHRg,4449
|
|
45
|
-
sempy_labs/_workspace_identity.py,sha256=
|
|
46
|
-
sempy_labs/_workspaces.py,sha256=
|
|
46
|
+
sempy_labs/_workspace_identity.py,sha256=Av_9hHBHzgOZE3mYiE9v6015tnAJfzfRyqm2_zUOt5c,2357
|
|
47
|
+
sempy_labs/_workspaces.py,sha256=iDVbGsHksDDli_6_v1wcL3a0xLIyXY8Bd1FDHpcRlOE,11510
|
|
47
48
|
sempy_labs/_bpa_translation/_model/_translations_am-ET.po,sha256=zQVjJ-t0vtgIYan-HaXtUVJLB_PJvB53Nf5BNoOReU4,39199
|
|
48
49
|
sempy_labs/_bpa_translation/_model/_translations_ar-AE.po,sha256=QP1PjDLFccLDs9zq456crdAST57wrcWVk5rRiqqoCws,36959
|
|
49
50
|
sempy_labs/_bpa_translation/_model/_translations_bg-BG.po,sha256=sqezjpS3wfk09WD7x27bHoCBtgmqeHtyHNKTwG7-bkI,44132
|
|
@@ -82,51 +83,51 @@ sempy_labs/_bpa_translation/_model/_translations_tr-TR.po,sha256=NdW-X4E0QmeLKM0
|
|
|
82
83
|
sempy_labs/_bpa_translation/_model/_translations_uk-UA.po,sha256=3NsFN8hoor_5L6738FjpJ8o4spwp8FNFGbVItHD-_ec,43500
|
|
83
84
|
sempy_labs/_bpa_translation/_model/_translations_zh-CN.po,sha256=ipMbnet7ZI5mZoC8KonYKVwGmFLHFB_9KIDOoBgSNfo,26815
|
|
84
85
|
sempy_labs/_bpa_translation/_model/_translations_zu-ZA.po,sha256=5v6tVKGruqneAeMoa6F3tyg_JBL8qOpqOJofWpq2W3U,31518
|
|
85
|
-
sempy_labs/admin/__init__.py,sha256=
|
|
86
|
-
sempy_labs/admin/_basic_functions.py,sha256=
|
|
86
|
+
sempy_labs/admin/__init__.py,sha256=YYOwKRfRr6alAez4BImlPcX9bQExATrb856BRq7a3O8,1945
|
|
87
|
+
sempy_labs/admin/_basic_functions.py,sha256=y0YnjGhQDmOfQTToSGTLTk48KFalylzPt8hsKeuFGrM,36969
|
|
87
88
|
sempy_labs/admin/_domains.py,sha256=5mv2SzIZCibvHwd4tgm-Lelj0zi66A2KKzQjDQgT9ms,12385
|
|
88
|
-
sempy_labs/admin/_external_data_share.py,sha256=
|
|
89
|
+
sempy_labs/admin/_external_data_share.py,sha256=NNdkBbs0OhSmZHNCN0QehWEdbx-amkxxLXAPBBKh11I,3512
|
|
89
90
|
sempy_labs/admin/_git.py,sha256=OY2F5ICKBXrB1HhlYDWdXQPnhTwSrMfWzEa2xcutClc,2181
|
|
90
|
-
sempy_labs/admin/_items.py,sha256=
|
|
91
|
-
sempy_labs/admin/_scanner.py,sha256=
|
|
91
|
+
sempy_labs/admin/_items.py,sha256=txVetZOlGLFVxfnkVi-b2Aw_oTA3ut0NHHOQ3E-nQJY,8464
|
|
92
|
+
sempy_labs/admin/_scanner.py,sha256=kun5Mib2Q6OolnaQ9lc0FuWzdxr3xm6KPWN9F3FKspM,4525
|
|
92
93
|
sempy_labs/directlake/__init__.py,sha256=etaj-3wqe5t93mu74tGYjEOQ6gtHWUogidOygiVvlq8,2131
|
|
93
|
-
sempy_labs/directlake/_directlake_schema_compare.py,sha256=
|
|
94
|
-
sempy_labs/directlake/_directlake_schema_sync.py,sha256=
|
|
95
|
-
sempy_labs/directlake/_dl_helper.py,sha256=
|
|
96
|
-
sempy_labs/directlake/_generate_shared_expression.py,sha256=
|
|
97
|
-
sempy_labs/directlake/_get_directlake_lakehouse.py,sha256=
|
|
98
|
-
sempy_labs/directlake/_get_shared_expression.py,sha256=
|
|
99
|
-
sempy_labs/directlake/_guardrails.py,sha256=
|
|
100
|
-
sempy_labs/directlake/_list_directlake_model_calc_tables.py,sha256=
|
|
101
|
-
sempy_labs/directlake/_show_unsupported_directlake_objects.py,sha256=
|
|
102
|
-
sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py,sha256=
|
|
103
|
-
sempy_labs/directlake/_update_directlake_partition_entity.py,sha256=
|
|
104
|
-
sempy_labs/directlake/_warm_cache.py,sha256=
|
|
94
|
+
sempy_labs/directlake/_directlake_schema_compare.py,sha256=zpt2voLmMUj8JhGi61tGFNetIfKn3ljqc7daLY7AAEw,4756
|
|
95
|
+
sempy_labs/directlake/_directlake_schema_sync.py,sha256=vzf8AkerBb_OKEVXHlZ3Ey4UO5YehKGTsw_-ewZmoQA,4437
|
|
96
|
+
sempy_labs/directlake/_dl_helper.py,sha256=SJ-tUUpaLIr2Q8_m5y0p5IobYq3B-NPHl2G5_a8oIfI,9853
|
|
97
|
+
sempy_labs/directlake/_generate_shared_expression.py,sha256=93ufAnD-qM0beRQp7lSzsuOAvhnMXqkoJoZei2RNVYg,3141
|
|
98
|
+
sempy_labs/directlake/_get_directlake_lakehouse.py,sha256=CxyGq6xvGihYDG-I3djCD4HGDePh6yh-PF32_2jHYj4,2592
|
|
99
|
+
sempy_labs/directlake/_get_shared_expression.py,sha256=qc85kXggkx_7Sz_rAAli_yPnLzrGZpgD8IfVbTfZhQM,1133
|
|
100
|
+
sempy_labs/directlake/_guardrails.py,sha256=YO8OycXDxmWrtH8nTz5a4AddfnpskM83rTPEPBVpqbM,2701
|
|
101
|
+
sempy_labs/directlake/_list_directlake_model_calc_tables.py,sha256=QA35_8YWK4b8-wEvHiRnCm9me_XD2noLqxAtE2pCgnY,2451
|
|
102
|
+
sempy_labs/directlake/_show_unsupported_directlake_objects.py,sha256=xu2PUaXtZAbgYksc0YSlIZvL9rh-oI6rLhHnHwoNjYI,3453
|
|
103
|
+
sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py,sha256=DC8Ig8oJtPY5qdWytIy03iiqYiQxLoRmQ5hsu6I69Sw,6348
|
|
104
|
+
sempy_labs/directlake/_update_directlake_partition_entity.py,sha256=aZV5Sg_VGth9HNbo2ZAjec44sZJiUjW4YVTMaURjx7I,8102
|
|
105
|
+
sempy_labs/directlake/_warm_cache.py,sha256=mFwyhtsCPJd3nDKcwMkyFtXbDhE77WCPBZkYppIRVq4,9207
|
|
105
106
|
sempy_labs/lakehouse/__init__.py,sha256=6LVQltQ3cjyiuxvjXTuNdJ163zSqi4h_tEZY4zsxuSw,647
|
|
106
|
-
sempy_labs/lakehouse/_get_lakehouse_columns.py,sha256=
|
|
107
|
-
sempy_labs/lakehouse/_get_lakehouse_tables.py,sha256=
|
|
108
|
-
sempy_labs/lakehouse/_lakehouse.py,sha256=
|
|
109
|
-
sempy_labs/lakehouse/_shortcuts.py,sha256=
|
|
107
|
+
sempy_labs/lakehouse/_get_lakehouse_columns.py,sha256=ptat3OXf19j4ITcynqUZQIgqfbvPubVTNU9zdfOW3lo,2704
|
|
108
|
+
sempy_labs/lakehouse/_get_lakehouse_tables.py,sha256=scO4oyXmeQTwF-m4etZ0W9BEInVpHhsPyZvtXjiU8cA,9084
|
|
109
|
+
sempy_labs/lakehouse/_lakehouse.py,sha256=4G7r2kyIcj_rhnPKzFqTFic4m0jeaPCBNLDzzp6TNtg,5404
|
|
110
|
+
sempy_labs/lakehouse/_shortcuts.py,sha256=YqII1rBOLebNPz8OroaTAgZFb96T61Lxqfzz4gct_Fo,8103
|
|
110
111
|
sempy_labs/migration/__init__.py,sha256=w4vvGk6wTWXVfofJDmio2yIFvSSJsxOpjv6mvNGmrOI,1043
|
|
111
|
-
sempy_labs/migration/_create_pqt_file.py,sha256=
|
|
112
|
+
sempy_labs/migration/_create_pqt_file.py,sha256=eRK0Jz9ZeV_7jV3kNRze0bTAIqxsAZXLKMGE_loKOaY,9677
|
|
112
113
|
sempy_labs/migration/_migrate_calctables_to_lakehouse.py,sha256=5fSZHylS8yLmk7maYDsvKbOqB9unxT4sQZq5HxBZwQY,17969
|
|
113
114
|
sempy_labs/migration/_migrate_calctables_to_semantic_model.py,sha256=yNSx126ru7-mUXI3iISwmw8a5jRCwcWw4l5eMXldrcU,6253
|
|
114
115
|
sempy_labs/migration/_migrate_model_objects_to_semantic_model.py,sha256=8IN45AKxic3_4yrC-N5rqWMzO6bCLF9qoyWxbxrvBHc,22900
|
|
115
116
|
sempy_labs/migration/_migrate_tables_columns_to_semantic_model.py,sha256=EiWWaIkNqBGlRKG64lo7gKO31XBuwym_IVvG405PzvM,7118
|
|
116
117
|
sempy_labs/migration/_migration_validation.py,sha256=pl5Yv4BwRHZfAL0p2soj_Gk8FL3UcwiqKbX23pJe1oQ,2788
|
|
117
|
-
sempy_labs/migration/_refresh_calc_tables.py,sha256=
|
|
118
|
+
sempy_labs/migration/_refresh_calc_tables.py,sha256=lKkwVBN7eyDoMJd0cv4jkLyO6iGjsuh96RPv6_Iiwrc,5537
|
|
118
119
|
sempy_labs/report/_BPAReportTemplate.json,sha256=9Uh-7E6d2ooxQ7j5JRayv_ayEULc7Gzg42kZGKdOqH8,63920
|
|
119
120
|
sempy_labs/report/__init__.py,sha256=esE_i1lL2AdcwWs7cE8AKSXZy_7w_4jJJtFULFkDPcU,1244
|
|
120
|
-
sempy_labs/report/_download_report.py,sha256=
|
|
121
|
-
sempy_labs/report/_generate_report.py,sha256=
|
|
122
|
-
sempy_labs/report/_paginated.py,sha256
|
|
123
|
-
sempy_labs/report/_report_bpa.py,sha256=
|
|
121
|
+
sempy_labs/report/_download_report.py,sha256=BtgcHiz1jYeC1fr908oPot9_K00Ej_OadCYfd2BKL6E,2848
|
|
122
|
+
sempy_labs/report/_generate_report.py,sha256=iZFYA3AQSWsW6zLrjiSP_DK7HkLp1ehujwl1g-3J8oY,12885
|
|
123
|
+
sempy_labs/report/_paginated.py,sha256=khQHoanEsxoVL3g08WrOPcsI3ggo9TAlb5cNXgOs7dg,2278
|
|
124
|
+
sempy_labs/report/_report_bpa.py,sha256=LhXHFonZc6JF6ao7UBPzcm5pte1nMGBmgKaDD2MrA7c,13849
|
|
124
125
|
sempy_labs/report/_report_bpa_rules.py,sha256=tPVGA0hmE6QMLlWtig7Va7Ksr2yXWl_Lndq--tWWd6w,4959
|
|
125
|
-
sempy_labs/report/_report_functions.py,sha256=
|
|
126
|
-
sempy_labs/report/_report_helper.py,sha256=
|
|
127
|
-
sempy_labs/report/_report_list_functions.py,sha256=
|
|
128
|
-
sempy_labs/report/_report_rebind.py,sha256=
|
|
129
|
-
sempy_labs/report/_reportwrapper.py,sha256=
|
|
126
|
+
sempy_labs/report/_report_functions.py,sha256=49TrYBIeWqth__q9GodacXIRdn90HBZfzBUv5nI01Gw,30007
|
|
127
|
+
sempy_labs/report/_report_helper.py,sha256=NcdWgFuh1GjDwVPzy6QWwg3ecaJKoWzZdhbxT6hbbdA,10599
|
|
128
|
+
sempy_labs/report/_report_list_functions.py,sha256=JDKb0RVN5hdytjf65PtQ1HJANMIj1FhvPCk3rmGxze4,3929
|
|
129
|
+
sempy_labs/report/_report_rebind.py,sha256=Q3J7I5EWmFWQ39s5W4x1kiobWjugxQsCpzj8RnaRAeM,5168
|
|
130
|
+
sempy_labs/report/_reportwrapper.py,sha256=hhCFw7ErQxR4rBk3m4mXt1pW5l87c9ia0I9y4CMrCHI,83328
|
|
130
131
|
sempy_labs/report/_bpareporttemplate/.platform,sha256=kWRa6B_KwSYLsvVFDx372mQriQO8v7dJ_YzQV_cfD-Q,303
|
|
131
132
|
sempy_labs/report/_bpareporttemplate/definition.pbir,sha256=bttyHZYKqjA8OBb_cezGlX4H82cDvGZVCl1QB3fij4E,343
|
|
132
133
|
sempy_labs/report/_bpareporttemplate/.pbi/localSettings.json,sha256=kzjBlNdjbsSBBSHBwbQc298AJCr9Vp6Ex0D5PemUuT0,1578
|
|
@@ -157,9 +158,9 @@ sempy_labs/report/_bpareporttemplate/definition/pages/c597da16dc7e63222a82/visua
|
|
|
157
158
|
sempy_labs/report/_bpareporttemplate/definition/pages/d37dce724a0ccc30044b/page.json,sha256=wBVuNc8S2NaUA0FC708w6stmR2djNZp8nAsHMqesgsc,293
|
|
158
159
|
sempy_labs/report/_bpareporttemplate/definition/pages/d37dce724a0ccc30044b/visuals/ce8532a7e25020271077/visual.json,sha256=mlY6t9OlSe-Y6_QmXJpS1vggU6Y3FjISUKECL8FVSg8,931
|
|
159
160
|
sempy_labs/tom/__init__.py,sha256=Qbs8leW0fjzvWwOjyWK3Hjeehu7IvpB1beASGsi28bk,121
|
|
160
|
-
sempy_labs/tom/_model.py,sha256=
|
|
161
|
-
semantic_link_labs-0.8.
|
|
162
|
-
semantic_link_labs-0.8.
|
|
163
|
-
semantic_link_labs-0.8.
|
|
164
|
-
semantic_link_labs-0.8.
|
|
165
|
-
semantic_link_labs-0.8.
|
|
161
|
+
sempy_labs/tom/_model.py,sha256=wYMJ6YgO6aX2lSIBXMktMkxY9JZFVwJGLRaDEBwQjfs,174828
|
|
162
|
+
semantic_link_labs-0.8.11.dist-info/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
|
|
163
|
+
semantic_link_labs-0.8.11.dist-info/METADATA,sha256=6rBFyBH6tpO4t6MulX1XfoMvRC-3jJ-Ms-JSfFtjoUw,21296
|
|
164
|
+
semantic_link_labs-0.8.11.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
165
|
+
semantic_link_labs-0.8.11.dist-info/top_level.txt,sha256=kiQX1y42Dbein1l3Q8jMUYyRulDjdlc2tMepvtrvixQ,11
|
|
166
|
+
semantic_link_labs-0.8.11.dist-info/RECORD,,
|
sempy_labs/__init__.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from sempy_labs._job_scheduler import list_item_job_instances
|
|
1
2
|
from sempy_labs._gateways import (
|
|
2
3
|
list_gateway_members,
|
|
3
4
|
list_gateway_role_assigments,
|
|
@@ -8,6 +9,7 @@ from sempy_labs._gateways import (
|
|
|
8
9
|
create_vnet_gateway,
|
|
9
10
|
update_vnet_gateway,
|
|
10
11
|
update_on_premises_gateway,
|
|
12
|
+
bind_semantic_model_to_gateway,
|
|
11
13
|
)
|
|
12
14
|
|
|
13
15
|
from sempy_labs._authentication import (
|
|
@@ -159,7 +161,8 @@ from sempy_labs._git import (
|
|
|
159
161
|
commit_to_git,
|
|
160
162
|
initialize_git_connection,
|
|
161
163
|
update_from_git,
|
|
162
|
-
|
|
164
|
+
connect_workspace_to_azure_dev_ops,
|
|
165
|
+
connect_workspace_to_github,
|
|
163
166
|
disconnect_workspace_from_git,
|
|
164
167
|
)
|
|
165
168
|
from sempy_labs._dataflows import (
|
|
@@ -205,6 +208,8 @@ from sempy_labs._list_functions import (
|
|
|
205
208
|
list_lakehouses,
|
|
206
209
|
list_sql_endpoints,
|
|
207
210
|
update_item,
|
|
211
|
+
list_server_properties,
|
|
212
|
+
list_semantic_model_errors,
|
|
208
213
|
)
|
|
209
214
|
from sempy_labs._helper_functions import (
|
|
210
215
|
convert_to_friendly_case,
|
|
@@ -230,6 +235,7 @@ from sempy_labs._helper_functions import (
|
|
|
230
235
|
get_capacity_id,
|
|
231
236
|
get_capacity_name,
|
|
232
237
|
resolve_capacity_name,
|
|
238
|
+
get_tenant_id,
|
|
233
239
|
)
|
|
234
240
|
from sempy_labs._model_bpa_bulk import (
|
|
235
241
|
run_model_bpa_bulk,
|
|
@@ -364,7 +370,8 @@ __all__ = [
|
|
|
364
370
|
"commit_to_git",
|
|
365
371
|
"initialize_git_connection",
|
|
366
372
|
"update_from_git",
|
|
367
|
-
"
|
|
373
|
+
"connect_workspace_to_azure_dev_ops",
|
|
374
|
+
"connect_workspace_to_github",
|
|
368
375
|
"disconnect_workspace_from_git",
|
|
369
376
|
"create_environment",
|
|
370
377
|
"delete_environment",
|
|
@@ -458,4 +465,9 @@ __all__ = [
|
|
|
458
465
|
"update_vnet_gateway",
|
|
459
466
|
"update_on_premises_gateway",
|
|
460
467
|
"get_semantic_model_definition",
|
|
468
|
+
"get_tenant_id",
|
|
469
|
+
"list_server_properties",
|
|
470
|
+
"bind_semantic_model_to_gateway",
|
|
471
|
+
"list_semantic_model_errors",
|
|
472
|
+
"list_item_job_instances",
|
|
461
473
|
]
|
sempy_labs/_authentication.py
CHANGED
|
@@ -91,11 +91,13 @@ class ServicePrincipalTokenProvider(TokenProvider):
|
|
|
91
91
|
|
|
92
92
|
return cls(credential)
|
|
93
93
|
|
|
94
|
-
def __call__(
|
|
94
|
+
def __call__(
|
|
95
|
+
self, audience: Literal["pbi", "storage", "azure", "graph"] = "pbi"
|
|
96
|
+
) -> str:
|
|
95
97
|
"""
|
|
96
98
|
Parameters
|
|
97
99
|
----------
|
|
98
|
-
audience : Literal["pbi", "storage"] = "pbi") -> str
|
|
100
|
+
audience : Literal["pbi", "storage", "azure", "graph"] = "pbi") -> str
|
|
99
101
|
Literal if it's for PBI/Fabric API call or OneLake/Storage Account call.
|
|
100
102
|
"""
|
|
101
103
|
if audience == "pbi":
|
|
@@ -104,5 +106,32 @@ class ServicePrincipalTokenProvider(TokenProvider):
|
|
|
104
106
|
).token
|
|
105
107
|
elif audience == "storage":
|
|
106
108
|
return self.credential.get_token("https://storage.azure.com/.default").token
|
|
109
|
+
elif audience == "azure":
|
|
110
|
+
return self.credential.get_token(
|
|
111
|
+
"https://management.azure.com/.default"
|
|
112
|
+
).token
|
|
113
|
+
elif audience == "graph":
|
|
114
|
+
return self.credential.get_token(
|
|
115
|
+
"https://graph.microsoft.com/.default"
|
|
116
|
+
).token
|
|
107
117
|
else:
|
|
108
118
|
raise NotImplementedError
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _get_headers(
|
|
122
|
+
token_provider: str, audience: Literal["pbi", "storage", "azure", "graph"] = "azure"
|
|
123
|
+
):
|
|
124
|
+
"""
|
|
125
|
+
Generates headers for an API request.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
token = token_provider(audience=audience)
|
|
129
|
+
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
|
|
132
|
+
if audience == "graph":
|
|
133
|
+
headers["ConsistencyLevel"] = "eventual"
|
|
134
|
+
else:
|
|
135
|
+
headers["Content-Type"] = "application/json"
|
|
136
|
+
|
|
137
|
+
return headers
|
sempy_labs/_clear_cache.py
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import sempy.fabric as fabric
|
|
2
2
|
from sempy_labs._helper_functions import (
|
|
3
|
-
resolve_dataset_id,
|
|
4
3
|
is_default_semantic_model,
|
|
5
4
|
_get_adls_client,
|
|
5
|
+
resolve_workspace_name_and_id,
|
|
6
|
+
resolve_dataset_name_and_id,
|
|
6
7
|
)
|
|
7
8
|
from typing import Optional
|
|
8
9
|
import sempy_labs._icons as icons
|
|
9
10
|
from sempy._utils._log import log
|
|
10
11
|
import pandas as pd
|
|
11
12
|
from sempy.fabric.exceptions import FabricHTTPException
|
|
13
|
+
from uuid import UUID
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
def clear_cache(dataset: str, workspace: Optional[str] = None):
|
|
16
|
+
def clear_cache(dataset: str | UUID, workspace: Optional[str | UUID] = None):
|
|
15
17
|
"""
|
|
16
18
|
Clears the cache of a semantic model.
|
|
17
19
|
See `here <https://learn.microsoft.com/analysis-services/instances/clear-the-analysis-services-caches?view=asallproducts-allversions>`_ for documentation.
|
|
18
20
|
|
|
19
21
|
Parameters
|
|
20
22
|
----------
|
|
21
|
-
dataset : str
|
|
22
|
-
Name of the semantic model.
|
|
23
|
-
workspace : str, default=None
|
|
24
|
-
The Fabric workspace name.
|
|
23
|
+
dataset : str | uuid.UUID
|
|
24
|
+
Name or ID of the semantic model.
|
|
25
|
+
workspace : str | uuid.UUID, default=None
|
|
26
|
+
The Fabric workspace name or ID.
|
|
25
27
|
Defaults to None which resolves to the workspace of the attached lakehouse
|
|
26
28
|
or if no lakehouse attached, resolves to the workspace of the notebook.
|
|
27
29
|
"""
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
30
32
|
if is_default_semantic_model(dataset=dataset, workspace=workspace):
|
|
31
33
|
raise ValueError(
|
|
32
34
|
f"{icons.red_dot} Cannot run XMLA operations against a default semantic model. Please choose a different semantic model. "
|
|
33
35
|
"See here for more information: https://learn.microsoft.com/fabric/data-warehouse/semantic-models"
|
|
34
36
|
)
|
|
35
37
|
|
|
36
|
-
dataset_id =
|
|
38
|
+
(dataset_name, dataset_id) = resolve_dataset_name_and_id(dataset, workspace_id)
|
|
37
39
|
|
|
38
40
|
xmla = f"""
|
|
39
41
|
<ClearCache xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
|
|
@@ -42,27 +44,27 @@ def clear_cache(dataset: str, workspace: Optional[str] = None):
|
|
|
42
44
|
</Object>
|
|
43
45
|
</ClearCache>
|
|
44
46
|
"""
|
|
45
|
-
fabric.execute_xmla(dataset=
|
|
47
|
+
fabric.execute_xmla(dataset=dataset_id, xmla_command=xmla, workspace=workspace_id)
|
|
46
48
|
print(
|
|
47
|
-
f"{icons.green_dot} Cache cleared for the '{
|
|
49
|
+
f"{icons.green_dot} Cache cleared for the '{dataset_name}' semantic model within the '{workspace_name}' workspace."
|
|
48
50
|
)
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
@log
|
|
52
54
|
def backup_semantic_model(
|
|
53
|
-
dataset: str,
|
|
55
|
+
dataset: str | UUID,
|
|
54
56
|
file_path: str,
|
|
55
57
|
allow_overwrite: bool = True,
|
|
56
58
|
apply_compression: bool = True,
|
|
57
|
-
workspace: Optional[str] = None,
|
|
59
|
+
workspace: Optional[str | UUID] = None,
|
|
58
60
|
):
|
|
59
61
|
"""
|
|
60
62
|
`Backs up <https://learn.microsoft.com/azure/analysis-services/analysis-services-backup>`_ a semantic model to the ADLS Gen2 storage account connected to the workspace.
|
|
61
63
|
|
|
62
64
|
Parameters
|
|
63
65
|
----------
|
|
64
|
-
dataset : str
|
|
65
|
-
Name of the semantic model.
|
|
66
|
+
dataset : str | uuid.UUID
|
|
67
|
+
Name or ID of the semantic model.
|
|
66
68
|
file_path : str
|
|
67
69
|
The ADLS Gen2 storage account location in which to backup the semantic model. Always saves within the 'power-bi-backup/<workspace name>' folder.
|
|
68
70
|
Must end in '.abf'.
|
|
@@ -72,8 +74,8 @@ def backup_semantic_model(
|
|
|
72
74
|
If True, overwrites backup files of the same name. If False, the file you are saving cannot have the same name as a file that already exists in the same location.
|
|
73
75
|
apply_compression : bool, default=True
|
|
74
76
|
If True, compresses the backup file. Compressed backup files save disk space, but require slightly higher CPU utilization.
|
|
75
|
-
workspace : str, default=None
|
|
76
|
-
The Fabric workspace name.
|
|
77
|
+
workspace : str | uuid.UUID, default=None
|
|
78
|
+
The Fabric workspace name or ID.
|
|
77
79
|
Defaults to None which resolves to the workspace of the attached lakehouse
|
|
78
80
|
or if no lakehouse attached, resolves to the workspace of the notebook.
|
|
79
81
|
"""
|
|
@@ -83,31 +85,32 @@ def backup_semantic_model(
|
|
|
83
85
|
f"{icons.red_dot} The backup file for restoring must be in the .abf format."
|
|
84
86
|
)
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
89
|
+
(dataset_name, dataset_id) = resolve_dataset_name_and_id(dataset, workspace_id)
|
|
87
90
|
|
|
88
91
|
tmsl = {
|
|
89
92
|
"backup": {
|
|
90
|
-
"database":
|
|
93
|
+
"database": dataset_name,
|
|
91
94
|
"file": file_path,
|
|
92
95
|
"allowOverwrite": allow_overwrite,
|
|
93
96
|
"applyCompression": apply_compression,
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
|
|
97
|
-
fabric.execute_tmsl(script=tmsl, workspace=
|
|
100
|
+
fabric.execute_tmsl(script=tmsl, workspace=workspace_id)
|
|
98
101
|
print(
|
|
99
|
-
f"{icons.green_dot} The '{
|
|
102
|
+
f"{icons.green_dot} The '{dataset_name}' semantic model within the '{workspace_name}' workspace has been backed up to the '{file_path}' location."
|
|
100
103
|
)
|
|
101
104
|
|
|
102
105
|
|
|
103
106
|
@log
|
|
104
107
|
def restore_semantic_model(
|
|
105
|
-
dataset: str,
|
|
108
|
+
dataset: str | UUID,
|
|
106
109
|
file_path: str,
|
|
107
110
|
allow_overwrite: bool = True,
|
|
108
111
|
ignore_incompatibilities: bool = True,
|
|
109
112
|
force_restore: bool = False,
|
|
110
|
-
workspace: Optional[str] = None,
|
|
113
|
+
workspace: Optional[str | UUID] = None,
|
|
111
114
|
):
|
|
112
115
|
"""
|
|
113
116
|
`Restores <https://learn.microsoft.com/power-bi/enterprise/service-premium-backup-restore-dataset>`_ a semantic model based on a backup (.abf) file
|
|
@@ -115,8 +118,8 @@ def restore_semantic_model(
|
|
|
115
118
|
|
|
116
119
|
Parameters
|
|
117
120
|
----------
|
|
118
|
-
dataset : str
|
|
119
|
-
Name of the semantic model.
|
|
121
|
+
dataset : str | uuid.UUID
|
|
122
|
+
Name or ID of the semantic model.
|
|
120
123
|
file_path : str
|
|
121
124
|
The location in which to backup the semantic model. Must end in '.abf'.
|
|
122
125
|
Example 1: file_path = 'MyModel.abf'
|
|
@@ -127,23 +130,23 @@ def restore_semantic_model(
|
|
|
127
130
|
If True, ignores incompatibilities between Azure Analysis Services and Power BI Premium.
|
|
128
131
|
force_restore: bool, default=False
|
|
129
132
|
If True, restores the semantic model with the existing semantic model unloaded and offline.
|
|
130
|
-
workspace : str, default=None
|
|
131
|
-
The Fabric workspace name.
|
|
133
|
+
workspace : str | uuid.UUID, default=None
|
|
134
|
+
The Fabric workspace name or ID.
|
|
132
135
|
Defaults to None which resolves to the workspace of the attached lakehouse
|
|
133
136
|
or if no lakehouse attached, resolves to the workspace of the notebook.
|
|
134
137
|
"""
|
|
135
|
-
# https://learn.microsoft.com/en-us/power-bi/enterprise/service-premium-backup-restore-dataset
|
|
136
138
|
|
|
137
139
|
if not file_path.endswith(".abf"):
|
|
138
140
|
raise ValueError(
|
|
139
141
|
f"{icons.red_dot} The backup file for restoring must be in the .abf format."
|
|
140
142
|
)
|
|
141
143
|
|
|
142
|
-
|
|
144
|
+
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
145
|
+
(dataset_name, dataset_id) = resolve_dataset_name_and_id(dataset, workspace_id)
|
|
143
146
|
|
|
144
147
|
tmsl = {
|
|
145
148
|
"restore": {
|
|
146
|
-
"database":
|
|
149
|
+
"database": dataset_name,
|
|
147
150
|
"file": file_path,
|
|
148
151
|
"allowOverwrite": allow_overwrite,
|
|
149
152
|
"security": "copyAll",
|
|
@@ -154,10 +157,10 @@ def restore_semantic_model(
|
|
|
154
157
|
if force_restore:
|
|
155
158
|
tmsl["restore"]["forceRestore"] = force_restore
|
|
156
159
|
|
|
157
|
-
fabric.execute_tmsl(script=tmsl, workspace=
|
|
160
|
+
fabric.execute_tmsl(script=tmsl, workspace=workspace_id)
|
|
158
161
|
|
|
159
162
|
print(
|
|
160
|
-
f"{icons.green_dot} The '{
|
|
163
|
+
f"{icons.green_dot} The '{dataset_name}' semantic model has been restored to the '{workspace_name}' workspace based on the '{file_path}' backup file."
|
|
161
164
|
)
|
|
162
165
|
|
|
163
166
|
|
|
@@ -243,15 +246,15 @@ def copy_semantic_model_backup_file(
|
|
|
243
246
|
|
|
244
247
|
|
|
245
248
|
@log
|
|
246
|
-
def list_backups(workspace: Optional[str] = None) -> pd.DataFrame:
|
|
249
|
+
def list_backups(workspace: Optional[str | UUID] = None) -> pd.DataFrame:
|
|
247
250
|
"""
|
|
248
251
|
Shows a list of backup files contained within a workspace's ADLS Gen2 storage account.
|
|
249
252
|
Requirement: An ADLS Gen2 storage account must be `connected to the workspace <https://learn.microsoft.com/power-bi/transform-model/dataflows/dataflows-azure-data-lake-storage-integration#connect-to-an-azure-data-lake-gen-2-at-a-workspace-level>`_.
|
|
250
253
|
|
|
251
254
|
Parameters
|
|
252
255
|
----------
|
|
253
|
-
workspace : str, default=None
|
|
254
|
-
The Fabric workspace name.
|
|
256
|
+
workspace : str | uuid.UUID, default=None
|
|
257
|
+
The Fabric workspace name or ID.
|
|
255
258
|
Defaults to None which resolves to the workspace of the attached lakehouse
|
|
256
259
|
or if no lakehouse attached, resolves to the workspace of the notebook.
|
|
257
260
|
|
|
@@ -262,8 +265,7 @@ def list_backups(workspace: Optional[str] = None) -> pd.DataFrame:
|
|
|
262
265
|
"""
|
|
263
266
|
|
|
264
267
|
client = fabric.PowerBIRestClient()
|
|
265
|
-
|
|
266
|
-
workspace_id = fabric.resolve_workspace_id(workspace)
|
|
268
|
+
(workspace_name, workspace_id) = resolve_workspace_name_and_id(workspace)
|
|
267
269
|
response = client.get(
|
|
268
270
|
f"/v1.0/myorg/resources?resourceType=StorageAccount&folderObjectId={workspace_id}"
|
|
269
271
|
)
|
|
@@ -274,7 +276,7 @@ def list_backups(workspace: Optional[str] = None) -> pd.DataFrame:
|
|
|
274
276
|
v = response.json().get("value", [])
|
|
275
277
|
if not v:
|
|
276
278
|
raise ValueError(
|
|
277
|
-
f"{icons.red_dot} A storage account is not associated with the '{
|
|
279
|
+
f"{icons.red_dot} A storage account is not associated with the '{workspace_name}' workspace."
|
|
278
280
|
)
|
|
279
281
|
storage_account = v[0]["resourceName"]
|
|
280
282
|
|