semantic-link-labs 0.9.3__py3-none-any.whl → 0.9.5__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 (68) hide show
  1. {semantic_link_labs-0.9.3.dist-info → semantic_link_labs-0.9.5.dist-info}/METADATA +25 -6
  2. {semantic_link_labs-0.9.3.dist-info → semantic_link_labs-0.9.5.dist-info}/RECORD +68 -52
  3. {semantic_link_labs-0.9.3.dist-info → semantic_link_labs-0.9.5.dist-info}/WHEEL +1 -1
  4. sempy_labs/__init__.py +45 -4
  5. sempy_labs/_capacities.py +22 -127
  6. sempy_labs/_capacity_migration.py +11 -9
  7. sempy_labs/_dashboards.py +60 -0
  8. sempy_labs/_data_pipelines.py +5 -31
  9. sempy_labs/_dax.py +17 -3
  10. sempy_labs/_delta_analyzer.py +279 -127
  11. sempy_labs/_environments.py +20 -48
  12. sempy_labs/_eventhouses.py +69 -30
  13. sempy_labs/_eventstreams.py +16 -34
  14. sempy_labs/_gateways.py +4 -4
  15. sempy_labs/_generate_semantic_model.py +30 -10
  16. sempy_labs/_git.py +90 -1
  17. sempy_labs/_graphQL.py +3 -20
  18. sempy_labs/_helper_functions.py +201 -44
  19. sempy_labs/_job_scheduler.py +226 -2
  20. sempy_labs/_kql_databases.py +19 -34
  21. sempy_labs/_kql_querysets.py +15 -32
  22. sempy_labs/_list_functions.py +14 -133
  23. sempy_labs/_mirrored_databases.py +14 -48
  24. sempy_labs/_ml_experiments.py +5 -30
  25. sempy_labs/_ml_models.py +4 -28
  26. sempy_labs/_model_bpa.py +17 -0
  27. sempy_labs/_model_bpa_rules.py +12 -2
  28. sempy_labs/_mounted_data_factories.py +119 -0
  29. sempy_labs/_notebooks.py +16 -26
  30. sempy_labs/_semantic_models.py +117 -0
  31. sempy_labs/_sql.py +78 -10
  32. sempy_labs/_sqldatabase.py +227 -0
  33. sempy_labs/_utils.py +42 -0
  34. sempy_labs/_vertipaq.py +17 -2
  35. sempy_labs/_warehouses.py +5 -17
  36. sempy_labs/_workloads.py +23 -9
  37. sempy_labs/_workspaces.py +13 -5
  38. sempy_labs/admin/__init__.py +70 -9
  39. sempy_labs/admin/_activities.py +166 -0
  40. sempy_labs/admin/_apps.py +143 -0
  41. sempy_labs/admin/_artifacts.py +62 -0
  42. sempy_labs/admin/_basic_functions.py +32 -704
  43. sempy_labs/admin/_capacities.py +311 -0
  44. sempy_labs/admin/_datasets.py +184 -0
  45. sempy_labs/admin/_domains.py +1 -1
  46. sempy_labs/admin/_items.py +3 -1
  47. sempy_labs/admin/_reports.py +239 -0
  48. sempy_labs/admin/_scanner.py +0 -1
  49. sempy_labs/admin/_shared.py +76 -0
  50. sempy_labs/admin/_tenant.py +489 -0
  51. sempy_labs/admin/_users.py +133 -0
  52. sempy_labs/admin/_workspaces.py +148 -0
  53. sempy_labs/directlake/_dl_helper.py +0 -1
  54. sempy_labs/directlake/_update_directlake_partition_entity.py +14 -0
  55. sempy_labs/graph/_teams.py +1 -1
  56. sempy_labs/graph/_users.py +9 -1
  57. sempy_labs/lakehouse/__init__.py +2 -0
  58. sempy_labs/lakehouse/_lakehouse.py +6 -7
  59. sempy_labs/lakehouse/_shortcuts.py +216 -64
  60. sempy_labs/report/__init__.py +3 -1
  61. sempy_labs/report/_download_report.py +4 -1
  62. sempy_labs/report/_export_report.py +272 -0
  63. sempy_labs/report/_generate_report.py +9 -17
  64. sempy_labs/report/_report_bpa.py +12 -19
  65. sempy_labs/report/_report_functions.py +9 -261
  66. sempy_labs/tom/_model.py +307 -40
  67. {semantic_link_labs-0.9.3.dist-info → semantic_link_labs-0.9.5.dist-info}/LICENSE +0 -0
  68. {semantic_link_labs-0.9.3.dist-info → semantic_link_labs-0.9.5.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: semantic-link-labs
3
- Version: 0.9.3
3
+ Version: 0.9.5
4
4
  Summary: Semantic Link Labs for Microsoft Fabric
5
5
  Author: Microsoft Corporation
6
6
  License: MIT License
@@ -26,7 +26,7 @@ Requires-Dist: pytest>=8.2.1; extra == "test"
26
26
  # Semantic Link Labs
27
27
 
28
28
  [![PyPI version](https://badge.fury.io/py/semantic-link-labs.svg)](https://badge.fury.io/py/semantic-link-labs)
29
- [![Read The Docs](https://readthedocs.org/projects/semantic-link-labs/badge/?version=0.9.3&style=flat)](https://readthedocs.org/projects/semantic-link-labs/)
29
+ [![Read The Docs](https://readthedocs.org/projects/semantic-link-labs/badge/?version=0.9.5&style=flat)](https://readthedocs.org/projects/semantic-link-labs/)
30
30
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
31
31
  [![Downloads](https://static.pepy.tech/badge/semantic-link-labs)](https://pepy.tech/project/semantic-link-labs)
32
32
 
@@ -34,6 +34,9 @@ Requires-Dist: pytest>=8.2.1; extra == "test"
34
34
  [Read the documentation on ReadTheDocs!](https://semantic-link-labs.readthedocs.io/en/stable/)
35
35
  ---
36
36
 
37
+ [Read the Wiki!](https://github.com/microsoft/semantic-link-labs/wiki)
38
+ ---
39
+
37
40
  Semantic Link Labs is a Python library designed for use in [Microsoft Fabric notebooks](https://learn.microsoft.com/fabric/data-engineering/how-to-use-notebook). This library extends the capabilities of [Semantic Link](https://learn.microsoft.com/fabric/data-science/semantic-link-overview) offering additional functionalities to seamlessly integrate and work alongside it. The goal of Semantic Link Labs is to simplify technical processes, empowering people to focus on higher level activities and allowing tasks that are better suited for machines to be efficiently handled without human intervention.
38
41
 
39
42
  If you encounter any issues, please [raise a bug](https://github.com/microsoft/semantic-link-labs/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=).
@@ -66,6 +69,7 @@ Check out the video below for an introduction to Semantic Link, Semantic Link La
66
69
  * [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
70
  * [Analyze delta tables for Direct Lake semantic models using Delta Analyzer](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Delta%20Analyzer.ipynb)
68
71
  * [View synonyms from the linguistic schema](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.list_synonyms)
72
+ * [Add](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.tom.html#sempy_labs.tom.TOMWrapper.add_incremental_refresh_policy), [update](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.tom.html#sempy_labs.tom.TOMWrapper.update_incremental_refresh_policy) and [view](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.tom.html#sempy_labs.tom.TOMWrapper.show_incremental_refresh_policy) an incremental refresh policy.
69
73
  * Reports
70
74
  * [Report Best Practice Analyzer (BPA)](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.report.html#sempy_labs.report.run_report_bpa)
71
75
  * [View report metadata](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Report%20Analysis.ipynb)
@@ -144,6 +148,8 @@ An even better way to ensure the semantic-link-labs library is available in your
144
148
  2. Select your newly created environment within the 'Environment' drop down in the navigation bar at the top of the notebook
145
149
 
146
150
  ## Version History
151
+ * [0.9.5](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.5) (March 7, 2025)
152
+ * [0.9.4](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.4) (February 27, 2025)
147
153
  * [0.9.3](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.3) (February 13, 2025)
148
154
  * [0.9.2](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.2) (February 5, 2025)
149
155
  * [0.9.1](https://github.com/microsoft/semantic-link-labs/releases/tag/0.9.1) (January 22, 2025)
@@ -284,10 +290,11 @@ python -m build
284
290
 
285
291
  #### Running and testing the .whl file
286
292
  1. Open a notebook in a Fabric workspace.
287
- 2. Navigate to 'Resources' within the Explorer tab.
288
- 3. Upload the .whl file here.
289
- 4. Drag the .whl file into a notebook cell.
290
- 5. Run the %pip install command generated by step 4.
293
+ 2. Navigate to 'Resources' within the Explorer tab on the left pane. Do not use the 'Files' section.
294
+ 3. Upload the .whl file to the 'Resource' section.
295
+ 4. Click on the '...' next to the .whl file and click 'Copy relative path'.
296
+ 5. Enter '%pip install ""' into a notebook cell. Within the double quotes, paste the copied path from step 4.
297
+ 6. Run the notebook cell.
291
298
 
292
299
  #### Submitting a Pull Request (PR)
293
300
  1. Within the 'Source Control' tab, commit your changes to the branch.
@@ -296,6 +303,18 @@ python -m build
296
303
  4. Enter details into the description.
297
304
  5. Click 'Create'.
298
305
 
306
+ #### Code Formatting
307
+ We use [black](github.com/psf/black) formatting as a code formatting standard. Make sure to run 'black' formatting on your code before submitting a pull request.
308
+
309
+ Run this code to install black
310
+ ```cli
311
+ pip install black
312
+ ```
313
+
314
+ Run this code to format your code using black
315
+ ```cli
316
+ python -m black src
317
+ ```
299
318
 
300
319
  ## Trademarks
301
320
 
@@ -1,52 +1,57 @@
1
- sempy_labs/__init__.py,sha256=l2Vnhvr_zSC9xnCQjuLdHCA2tBOj2pRTht1GPwmOvbo,13933
1
+ sempy_labs/__init__.py,sha256=YJVsQPcDSMiXCXSSeWYvqptLTgw7woGOAUWO_dTTOj4,15133
2
2
  sempy_labs/_ai.py,sha256=rhVohfwrU1mvWH0EN_vCTnldb8xJNfGHZGba34k1JVw,16174
3
3
  sempy_labs/_authentication.py,sha256=GjtN5XqIyWXbR5Ni4hfYiUNwgFa-ySX8e-BrqE1vgGc,6903
4
- sempy_labs/_capacities.py,sha256=7rR4BL5XuWr5UO25jp8_5moymvX35AY_FG27H4HUcqQ,43949
5
- sempy_labs/_capacity_migration.py,sha256=wzOD14W7lCTx539GvkBSROMnTHEYNeFkz4L4C-0CXOQ,24762
4
+ sempy_labs/_capacities.py,sha256=0JStFjrkDnpDQJyttMCtNNZG5rJvLRZ_WjCheFjVFT8,39509
5
+ sempy_labs/_capacity_migration.py,sha256=bNjVHFMYS1izIs_yiBAB8c9mOum_oAjqzmuhelYem7U,24796
6
6
  sempy_labs/_clear_cache.py,sha256=5z73I4Zdr3C0Bd4zyxrQdcGG2VOzsXWukzB_evm4bRs,12731
7
7
  sempy_labs/_connections.py,sha256=aLMneYcw9on-GXr6KIGmDIvo8cuMevbkmtlmB3uWXhU,18693
8
- sempy_labs/_data_pipelines.py,sha256=pL6hkYxHifZk6OCBt3MJm-eG2lK4iaYXs0FbbGGbXEc,5564
8
+ sempy_labs/_dashboards.py,sha256=cyFD-pUUFu4scGkbitilrI22GW5dTmTkUZ15ou7Bl-A,1880
9
+ sempy_labs/_data_pipelines.py,sha256=cW_WGmuWD4V9IgLprKL4TqFXgid4eTBXvEL3-IArS0w,4817
9
10
  sempy_labs/_dataflows.py,sha256=SZThUDRQcWujK30nNw1YI06y1L6-piNHLiPBb72s9Bk,8049
10
- sempy_labs/_dax.py,sha256=2FCN2SInk8E5LMNMO5fnrWhQ-gC9S-B4FG3bDYUk_Jk,16452
11
- sempy_labs/_delta_analyzer.py,sha256=_o8DvD7wWxKTGpGEZ5F1mIM2yp28_-U0v0Y-eNPIHZ8,11608
11
+ sempy_labs/_dax.py,sha256=cFaXJUHuG93lYmjq_4CLG6gStvSTtgvJ8NA43TqeW_g,16871
12
+ sempy_labs/_delta_analyzer.py,sha256=TFZFlrC4_AYdPv0St3E9Spxtm7qILRPfOLvxxxq6OcY,17403
12
13
  sempy_labs/_deployment_pipelines.py,sha256=SDQYkCAhOAlxBr58jYxtLFOVySiRXO0_WhfOKGDeYZQ,6254
13
14
  sempy_labs/_documentation.py,sha256=yVA8VPEzx_fmljtcvSxtB7-BeupYsfdMXXjp6Fpnyo8,5007
14
- sempy_labs/_environments.py,sha256=F0lbOqkBGFINIB49C9M_bv-F3A5OtwyYbCFKdCHkkQc,5433
15
- sempy_labs/_eventhouses.py,sha256=bxbcCIq0qH2_k5A1x7z-BDfzPMoE8f1sFm9SUIHJ9Go,3948
16
- sempy_labs/_eventstreams.py,sha256=TY0HBWRjizonKr3g8doKrffvOqlGY4l1VomcBnUUh-g,3996
15
+ sempy_labs/_environments.py,sha256=mVZn24mPtRvFaOSXWhMqD5RddU8N_P2_85hNVcrrt7U,4580
16
+ sempy_labs/_eventhouses.py,sha256=HgvuhRVBol2Y0T4JYRg6xsg4xHXShFwEB_uxFIDVHVU,5164
17
+ sempy_labs/_eventstreams.py,sha256=c8nNdRM8eeDOYXd_AtRp7zYHYaqV9p1bI2V0boUrCuA,3492
17
18
  sempy_labs/_external_data_shares.py,sha256=MP0nx9uFzjiV04xpq09UAM8n_1ckPBae2uhI6Vk0ZoY,6537
18
- sempy_labs/_gateways.py,sha256=tbSEOGCc-mnvAYTVwJeDv8nWZkokf_OUOGfh3z8ePbw,17495
19
- sempy_labs/_generate_semantic_model.py,sha256=OtzWWJ1EeDCYfEKn5TKnAUfbXOvqNI3cNkoJow3KkmE,17865
20
- sempy_labs/_git.py,sha256=lB0mJMGecvS1scPTbMolk0Tg_0skdbaj0-9W_2cA1K0,15014
21
- sempy_labs/_graphQL.py,sha256=7zyXXzsA_l2NeumeSrg5J7JMAexHFzeKFr59XTJWfrk,2906
22
- sempy_labs/_helper_functions.py,sha256=3v3pY9dLe8KBLXztaauzrsjXDvWJciF3C2It1pawX-M,47624
19
+ sempy_labs/_gateways.py,sha256=6JE6VeGFPKF617sf2mMkxXVOz57YHI5jAQLAF-BzRLc,17527
20
+ sempy_labs/_generate_semantic_model.py,sha256=DOdtIdN4JJeemZ7jpBGFaHFEZkkk5u_JHWGPlWExsUM,18531
21
+ sempy_labs/_git.py,sha256=RyaT4XzrSi-4NLJZWiWZnnNpMgrKzRNxhyY8b1O2I6c,17819
22
+ sempy_labs/_graphQL.py,sha256=nBvuZefJaK7fGdJelQhFFoIvUJQcnwK2rODq0IX9JfM,2478
23
+ sempy_labs/_helper_functions.py,sha256=z73XNSmJRU1u545H6WoaziUuOnWasEuuH3qSKOYDn5A,52723
23
24
  sempy_labs/_icons.py,sha256=ez2dx_LCti71S_-eB6WYQ-kOMyiBL8ZJN12-ev5dcmA,3579
24
- sempy_labs/_job_scheduler.py,sha256=kVuBiUhzaNJJ7d_HiP3CNhMe3lHa6u87MyYAWslgghA,7522
25
- sempy_labs/_kql_databases.py,sha256=ed5w9k9iACsy7hMr0pBQB3ETKW3rucVZuRc-FVb_ihY,4524
26
- sempy_labs/_kql_querysets.py,sha256=7E9FpV_wlZ1F_S2GncAzRiHoryqDQFvZaRftde0_oKc,4036
27
- sempy_labs/_list_functions.py,sha256=O6EDE8-MdPkkb6VWlN9gl4IxkT5s1oL5muggqd_0ZlY,66614
25
+ sempy_labs/_job_scheduler.py,sha256=_-Pifkttk1oPNxewxwWcQ4QC_Hr24GSi6nmrEXwc0pc,15814
26
+ sempy_labs/_kql_databases.py,sha256=V7-rqOVOvdBrDRid17DkPFB2DBFeHz1BMbomQqOuFR8,4000
27
+ sempy_labs/_kql_querysets.py,sha256=Jjcs4SkjeirnDkG6zfsl0KRUXVzMyWii0Yn0JMWwln8,3502
28
+ sempy_labs/_list_functions.py,sha256=qHsArkVsBS0OW6gFkyZvRrIyT0Dh7eP2n2Ch0q1Aj9Y,62564
28
29
  sempy_labs/_managed_private_endpoints.py,sha256=Po5ki9jQ5Wg3uxvHkAWuhtPHAkgOYspv19ZoAYzg9JM,6350
29
- sempy_labs/_mirrored_databases.py,sha256=OrxHlMjahW0Bx5GfTwAHGxDO5hy-9Pt5e9N5HKiRjLo,14028
30
+ sempy_labs/_mirrored_databases.py,sha256=kRVcMU616yrX4Wp6np67fWCk2nelNd4T5WLkSqOv4JQ,12970
30
31
  sempy_labs/_mirrored_warehouses.py,sha256=Q3WlRjUwCLz8KW1eN8MiTPeY0P52Vkuz5kgnv4GvQ3k,1739
31
- sempy_labs/_ml_experiments.py,sha256=pTpc7vx5z7dvjaViB8DMbiIEN7thVO4cLhyUKP-RYpE,4057
32
- sempy_labs/_ml_models.py,sha256=BGnYC0-K1cb9VikCmqods5bxckzYplkJkDO3jwttpqI,3924
32
+ sempy_labs/_ml_experiments.py,sha256=k1-7wBub4kVkOzxazEtEBZVcQ7SAJ_S_Ze0XGHR3okI,3373
33
+ sempy_labs/_ml_models.py,sha256=69i67MHn-_Fsq-5slLxxhCF8N2s0JBYn_CDTa1Hhhs0,3261
33
34
  sempy_labs/_model_auto_build.py,sha256=PTQo3dufzLSFcQ5shFkmBWAVSdP7cTJgpUclrcXyNbg,5105
34
- sempy_labs/_model_bpa.py,sha256=SWKVe5WwfmU7OZVyCbsUlK0w6VdJ08MLklQbPJ98Z64,21376
35
+ sempy_labs/_model_bpa.py,sha256=RXFNChiBX_ulzsIXkkC5FOdNogsGZKUmzu8v5cvVp6E,22375
35
36
  sempy_labs/_model_bpa_bulk.py,sha256=F_AzebdpMm7QvYuSuSj52NTg6jYE9H1FJJDpdnyNF-g,16039
36
- sempy_labs/_model_bpa_rules.py,sha256=L1xu5T5LsTxsk-KyrCB561BKzgAkj7izDbSiyMA6upY,45651
37
+ sempy_labs/_model_bpa_rules.py,sha256=L3XaK1SThgz3h0uTZZH92IVkWooG5rhqVus-ddnBIHw,45975
37
38
  sempy_labs/_model_dependencies.py,sha256=0xGgubrq76zIvBdEqmEX_Pd6WdizXFVECBW6BPl2DZo,13162
38
- sempy_labs/_notebooks.py,sha256=Ev8E4kxJHAnpqUacBxmov227pZH54CwbCP-C6OpjWD0,8458
39
+ sempy_labs/_mounted_data_factories.py,sha256=-IBxE5XurYyeeQg7BvpXSSR1MW3rRGmue6UGpqlo96U,3906
40
+ sempy_labs/_notebooks.py,sha256=GbyBDay_c4dnPmS32e8qgRrKVb3evi_omSMzq-Xk9z0,8082
39
41
  sempy_labs/_one_lake_integration.py,sha256=3RYJ6det_oM3NcAqwrONATTggkNAXRZFvVbrOA1Pg94,6274
40
42
  sempy_labs/_query_scale_out.py,sha256=nra1q8s-PKpZTlI_L0lMGO1GmdBk6sqETsBQShF1yPY,15352
41
43
  sempy_labs/_refresh_semantic_model.py,sha256=4w_uaYLbaZptmEFY7QHWzOgXcgc2ctGx8HQvt2aguxk,17360
44
+ sempy_labs/_semantic_models.py,sha256=PeH80kas-a0bQY6fmsjVWVQXZHYq34qZHjAVP847mCo,3699
42
45
  sempy_labs/_spark.py,sha256=SuSTjjmtzj7suDgN8Njk_pNBaStDLgIJB_1yk_e2H1Y,19340
43
- sempy_labs/_sql.py,sha256=cXPjmb3OiOucdWi8QU73lPUiNnZ3LOeoBpoaRwjj1l4,5337
46
+ sempy_labs/_sql.py,sha256=vgAI9YRpDwMTZuNn4ptd8fwyGN5QQTBYR0SnB2CpfAg,8028
47
+ sempy_labs/_sqldatabase.py,sha256=Jyp4bkinFfn7UaHjUtaT3FiT5IO7_uYcvOemk7bc5Ic,7829
44
48
  sempy_labs/_translations.py,sha256=i4K2PFk6-TcmAnUpqz-z_GuDv9XEp1cBs0KY-x6ja1w,16168
45
- sempy_labs/_vertipaq.py,sha256=xssYOQeVsEbptzWZAfhIuVb4n9WQKn64F329ONal1FI,38052
46
- sempy_labs/_warehouses.py,sha256=EKUrgPXmQEvdZxY84CazKdbz6Sd8vqaV7sq7UF4odl0,7302
47
- sempy_labs/_workloads.py,sha256=uuTl-_7D_nubwCY5xrTfWF1apTpFbgRKwdY0oNFPDSk,4216
49
+ sempy_labs/_utils.py,sha256=aKGnUiXSLLRQRXXv8TH_XhGcOtDsnrs0RHmQ6YZMn3o,1786
50
+ sempy_labs/_vertipaq.py,sha256=gXK6l8zZ7AOayVe-trRGqSXPGC6jmOvJVOkt67oogI4,38789
51
+ sempy_labs/_warehouses.py,sha256=0wkyC9Jr04VrmS05y8fg7rkmPRZYTE6A-vYzDoCzVgc,6955
52
+ sempy_labs/_workloads.py,sha256=ifQ6Jv0_MDzjfu993bU8V7thOdW5kFyp3MjA082rsrE,4687
48
53
  sempy_labs/_workspace_identity.py,sha256=ZtaaYyFUmRabdxCYw9xoUNRwKvXi1YibryI9Ww9MzxU,2155
49
- sempy_labs/_workspaces.py,sha256=_4cwd5lg4JMEGuHaKyLHo7JQGJDb3v93eOO3Q8RYo44,11004
54
+ sempy_labs/_workspaces.py,sha256=paYNM3GybpTCsL7HsX3f12I5_1PT3joeYJXZ_RsHpmY,11233
50
55
  sempy_labs/_bpa_translation/_model/_translations_am-ET.po,sha256=zQVjJ-t0vtgIYan-HaXtUVJLB_PJvB53Nf5BNoOReU4,39199
51
56
  sempy_labs/_bpa_translation/_model/_translations_ar-AE.po,sha256=QP1PjDLFccLDs9zq456crdAST57wrcWVk5rRiqqoCws,36959
52
57
  sempy_labs/_bpa_translation/_model/_translations_bg-BG.po,sha256=sqezjpS3wfk09WD7x27bHoCBtgmqeHtyHNKTwG7-bkI,44132
@@ -85,17 +90,27 @@ sempy_labs/_bpa_translation/_model/_translations_tr-TR.po,sha256=NdW-X4E0QmeLKM0
85
90
  sempy_labs/_bpa_translation/_model/_translations_uk-UA.po,sha256=3NsFN8hoor_5L6738FjpJ8o4spwp8FNFGbVItHD-_ec,43500
86
91
  sempy_labs/_bpa_translation/_model/_translations_zh-CN.po,sha256=ipMbnet7ZI5mZoC8KonYKVwGmFLHFB_9KIDOoBgSNfo,26815
87
92
  sempy_labs/_bpa_translation/_model/_translations_zu-ZA.po,sha256=5v6tVKGruqneAeMoa6F3tyg_JBL8qOpqOJofWpq2W3U,31518
88
- sempy_labs/admin/__init__.py,sha256=ZH4hnVyBpMZbgtcVeeagsJ7J0ihE7QES3WxIL4z78g4,1995
89
- sempy_labs/admin/_basic_functions.py,sha256=vrHszPvZdHF2UIYkpkYPDKKc1YfX5ZHlakYC6kDup4Q,39495
90
- sempy_labs/admin/_domains.py,sha256=pw9_szJEiclYH__v7cMeAHMLgYBhFTYTixK-b-5x3Jc,15064
93
+ sempy_labs/admin/__init__.py,sha256=MIWuLkSdQ4BsHBgRKWMkPi1atDA-bQeUeRhNPW6_IEs,3741
94
+ sempy_labs/admin/_activities.py,sha256=YfISDzhXro9glEa_yJmoYv-2q2M1DIkoyNzgLl7eWuI,6695
95
+ sempy_labs/admin/_apps.py,sha256=PUEQlXbzVR9u3ZUQUhpfU3J-hfa8A2nTGFBpCqzMdW0,4085
96
+ sempy_labs/admin/_artifacts.py,sha256=eCiNBdgNSUhOsE3i-Y1lp6p6T3is7RZJPy7ctu36oW4,2246
97
+ sempy_labs/admin/_basic_functions.py,sha256=if6ZEqKvM7wSzW9E2CxFbGwQDl_JH32eo-qIKz24sWY,15388
98
+ sempy_labs/admin/_capacities.py,sha256=O-hqtiWWjZC25hOFLnx_PvnH0-m9Ky_hx3_1ubLUkgI,9863
99
+ sempy_labs/admin/_datasets.py,sha256=kMerpBNro--kKdp2rhEKnVe0JDGjMDsxqgfbbw17K-U,6235
100
+ sempy_labs/admin/_domains.py,sha256=Z0EhIJCcujx1NumeqM4eKAvai18p-9TAw1WJaU-cbbE,15076
91
101
  sempy_labs/admin/_external_data_share.py,sha256=q4gw5iYZJDH-9xIM6L0b2CU9ebUIdE-ZVrFsulRHyUU,3364
92
102
  sempy_labs/admin/_git.py,sha256=gsbDQKd66knCI_Zh8vHSfHK-uQVJjVmhKKvfMMYKZyA,2264
93
- sempy_labs/admin/_items.py,sha256=8RT3CqFQiDCs-XEgAtQeD3YSFezOz3_E_MArTZAiV-o,8705
94
- sempy_labs/admin/_scanner.py,sha256=58mez0RchcPd3aelD7bJKtg9lI1uqDDmJ_z_ATYiwvs,4453
103
+ sempy_labs/admin/_items.py,sha256=zX-eUDyQWiB8mY8Nojj03-_R728JvVIOlp0iEOisnKE,8750
104
+ sempy_labs/admin/_reports.py,sha256=qkqV53w6XG-eyCrYWSEUG5xm7WARu4y8H5DzibbSHuE,7858
105
+ sempy_labs/admin/_scanner.py,sha256=Nz4HPf-ibf-wl2I4_8gR88P6SwaourpjcCrpsjLfUK8,4434
106
+ sempy_labs/admin/_shared.py,sha256=srgkqttbMbK5XXjOt4zeAV8rMCvK7zEus55HsGtNUFI,3007
107
+ sempy_labs/admin/_tenant.py,sha256=6CrJ8LBz5epst5kmqxbhoc0AmaU5KHZCJ36Hj6mlaVY,19141
108
+ sempy_labs/admin/_users.py,sha256=eEOkgvny3FwMuUrSIBQ0n3JwrzWV_6_nwGc8_c-eXSM,4571
109
+ sempy_labs/admin/_workspaces.py,sha256=XiiO3vyuJxKkVf9ZrW7261wHSBrnd8r7rbia8HGDFkI,4911
95
110
  sempy_labs/directlake/__init__.py,sha256=etaj-3wqe5t93mu74tGYjEOQ6gtHWUogidOygiVvlq8,2131
96
111
  sempy_labs/directlake/_directlake_schema_compare.py,sha256=In3Ac07GI6T3eLDvQK7Xt9bXwJLI7MgNAk83rOKsYKc,5040
97
112
  sempy_labs/directlake/_directlake_schema_sync.py,sha256=5nDyE-8ApeaUJO9aJLasop8G9bG9TjPamDQvgAlCUew,4671
98
- sempy_labs/directlake/_dl_helper.py,sha256=jNWyrEbR0eNSPqaDeraUcTv1rMMvj8gipzxnSvdJl1g,10687
113
+ sempy_labs/directlake/_dl_helper.py,sha256=rr510sIDv5FL5Ipz-YqZWjY6XomBNhhoFbzWZcUyJvE,10672
99
114
  sempy_labs/directlake/_generate_shared_expression.py,sha256=WkE2onOO6XiloMNFdwwavGlANgmDGFMv2NXpqorhDAc,3002
100
115
  sempy_labs/directlake/_get_directlake_lakehouse.py,sha256=e0WFQm4-daJR4K1aHuVaubu7T26yTeBgfNEMOXk-EzM,2392
101
116
  sempy_labs/directlake/_get_shared_expression.py,sha256=qc85kXggkx_7Sz_rAAli_yPnLzrGZpgD8IfVbTfZhQM,1133
@@ -103,17 +118,17 @@ sempy_labs/directlake/_guardrails.py,sha256=YO8OycXDxmWrtH8nTz5a4AddfnpskM83rTPE
103
118
  sempy_labs/directlake/_list_directlake_model_calc_tables.py,sha256=EYT4ELmOZ3Uklzy6uMQMidc4WtBXm21NQqZu1Q5HTsg,2509
104
119
  sempy_labs/directlake/_show_unsupported_directlake_objects.py,sha256=nmrZrtDez7U8Ji76i9fxnnTx1zxMu2LCOZTMz4sFUEc,3504
105
120
  sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py,sha256=DC8Ig8oJtPY5qdWytIy03iiqYiQxLoRmQ5hsu6I69Sw,6348
106
- sempy_labs/directlake/_update_directlake_partition_entity.py,sha256=z6dSrzPzRTQOVByLcGigMyXOF9YAUjSEqeAyAeVGh5U,8335
121
+ sempy_labs/directlake/_update_directlake_partition_entity.py,sha256=I2Qe2jrvUtNy6Wi75fHg47L4aRiw0UNQfQbURsyZhGY,8984
107
122
  sempy_labs/directlake/_warm_cache.py,sha256=xc7gG_OJY1rJYg79ztgcLATpnXHNqFaw-6CU1HgdlXk,9258
108
123
  sempy_labs/graph/__init__.py,sha256=AZ_IpOL06VvXrYmgbcrvQlxCxdDksvwXKf7JAGohCNI,620
109
124
  sempy_labs/graph/_groups.py,sha256=2axQ__eHNgJfb0ITOjexysz2Tq4AQ7xSejH4zG-QCFc,12531
110
- sempy_labs/graph/_teams.py,sha256=IxYaYxD3L6RGf4XFiC6VCLH5tqNWGEijtulEG8RwdRM,3043
111
- sempy_labs/graph/_users.py,sha256=5leq_Htox_rfbGQvK4T7NvNasur-HuoFey26qrSHjYM,5652
112
- sempy_labs/lakehouse/__init__.py,sha256=k4offCjolrw8cpe1mj5AmPq5JcwsxohBwqR37nNc_7E,757
125
+ sempy_labs/graph/_teams.py,sha256=KTkIHd9XShsAiv1RsmVQpL2XmUVt4p9QyJFMP5evDj4,3050
126
+ sempy_labs/graph/_users.py,sha256=o3bnpjln-K8JDAJQlcjpfgthAHPTT3CiAYzsx-3n6I4,5898
127
+ sempy_labs/lakehouse/__init__.py,sha256=htZjFvJs3hCUUtMzRHQKbG6JlyC808QmXa_sVrPj0xg,799
113
128
  sempy_labs/lakehouse/_get_lakehouse_columns.py,sha256=FWCyJhqqnZg837eK-S5st0xZpxbhxkcS8aTguazxjjY,2685
114
129
  sempy_labs/lakehouse/_get_lakehouse_tables.py,sha256=OmgYLNiegc8HwJP7hEPo5JMWFPyDIPSoqewBxsDkucc,8544
115
- sempy_labs/lakehouse/_lakehouse.py,sha256=sD1bQ2mEnSmRJLd1D1yMeXOZHRvq8ZlyAGxjLCwFi0s,8734
116
- sempy_labs/lakehouse/_shortcuts.py,sha256=ASlHqJR5mGgRTjQkKvZXKXT7-hHjgeKVqhtXh5joYqk,8819
130
+ sempy_labs/lakehouse/_lakehouse.py,sha256=dzDhBGN2FizREYFMsDsDzGm9cwLln1__OTAV_JV_GPY,8753
131
+ sempy_labs/lakehouse/_shortcuts.py,sha256=SS-FYRfdIHkeS-6lN7_S85SxjxlS5j5EJshEveKvKH0,15283
117
132
  sempy_labs/migration/__init__.py,sha256=142n01VAqlcx4E0mGGRtUfVOEwAXVdiHI_XprmUm7As,1175
118
133
  sempy_labs/migration/_create_pqt_file.py,sha256=eRK0Jz9ZeV_7jV3kNRze0bTAIqxsAZXLKMGE_loKOaY,9677
119
134
  sempy_labs/migration/_direct_lake_to_import.py,sha256=uMqvElwkCHMyraP9t2nGNgstRobiHPFo4AMuS60dXyU,2732
@@ -124,13 +139,14 @@ sempy_labs/migration/_migrate_tables_columns_to_semantic_model.py,sha256=HYi2vn7
124
139
  sempy_labs/migration/_migration_validation.py,sha256=pl5Yv4BwRHZfAL0p2soj_Gk8FL3UcwiqKbX23pJe1oQ,2788
125
140
  sempy_labs/migration/_refresh_calc_tables.py,sha256=W-lYdUZZcoYyLRIpMdpgaz03PEMM6Zf7E1vzT6MmMAE,5516
126
141
  sempy_labs/report/_BPAReportTemplate.json,sha256=9Uh-7E6d2ooxQ7j5JRayv_ayEULc7Gzg42kZGKdOqH8,63920
127
- sempy_labs/report/__init__.py,sha256=esE_i1lL2AdcwWs7cE8AKSXZy_7w_4jJJtFULFkDPcU,1244
128
- sempy_labs/report/_download_report.py,sha256=hX6BlIN1dCE6wiDpTZymGus9ZC4UnnI32OiUeMQ7PN0,2709
129
- sempy_labs/report/_generate_report.py,sha256=Ir4xDldITvWWJebbY1Ljj5m04cKQ8oPTQta83LtALoc,14253
142
+ sempy_labs/report/__init__.py,sha256=wnmjUX3w521OYnQBV3h9EaJs1eFLkIxmjc59VQOC19I,1293
143
+ sempy_labs/report/_download_report.py,sha256=Hu2cVzXN_6yjHJKvS0KGy0uwbbJNxd0P-w6M8-XeZao,2767
144
+ sempy_labs/report/_export_report.py,sha256=XCMsZzTBMgvQOe3Ltdod7my7_izpmP-3AVH6W5CExPE,10976
145
+ sempy_labs/report/_generate_report.py,sha256=6Glk_q6f68aIHQJy_7EJjCJbNMRUJbnGriOyUJ2Qub8,13946
130
146
  sempy_labs/report/_paginated.py,sha256=rsElE0IQ9qxRDuEp6qNF1EcD5XEgfTc7WsWEQsalsuI,2156
131
- sempy_labs/report/_report_bpa.py,sha256=bMZlvFVKypRCC7uC0QmkqV9i4n5nMj3X-tI2N6OOxLc,13861
147
+ sempy_labs/report/_report_bpa.py,sha256=ClETB8Q41sY1scCuknhpvalvuBaQ9ZwA4QX7F3sPcjc,13596
132
148
  sempy_labs/report/_report_bpa_rules.py,sha256=tPVGA0hmE6QMLlWtig7Va7Ksr2yXWl_Lndq--tWWd6w,4959
133
- sempy_labs/report/_report_functions.py,sha256=DlfGtDtTS3kM0v039UOHEHQ8_7I2jj2jBaQYoHJpfKY,29884
149
+ sempy_labs/report/_report_functions.py,sha256=XojlMOuAYompdDk1bNaJx6KRK7MRsZ6vfLTiBXfjdXA,19680
134
150
  sempy_labs/report/_report_helper.py,sha256=NcdWgFuh1GjDwVPzy6QWwg3ecaJKoWzZdhbxT6hbbdA,10599
135
151
  sempy_labs/report/_report_list_functions.py,sha256=K9tMDQKhIZhelHvfMMW0lsxbVHekJ-5dAQveoD7PUDA,3980
136
152
  sempy_labs/report/_report_rebind.py,sha256=pOzg_XWbip8ledM79APsLxUjLJNS9aTDKK9dEx1F7Ds,4990
@@ -165,9 +181,9 @@ sempy_labs/report/_bpareporttemplate/definition/pages/c597da16dc7e63222a82/visua
165
181
  sempy_labs/report/_bpareporttemplate/definition/pages/d37dce724a0ccc30044b/page.json,sha256=wBVuNc8S2NaUA0FC708w6stmR2djNZp8nAsHMqesgsc,293
166
182
  sempy_labs/report/_bpareporttemplate/definition/pages/d37dce724a0ccc30044b/visuals/ce8532a7e25020271077/visual.json,sha256=mlY6t9OlSe-Y6_QmXJpS1vggU6Y3FjISUKECL8FVSg8,931
167
183
  sempy_labs/tom/__init__.py,sha256=Qbs8leW0fjzvWwOjyWK3Hjeehu7IvpB1beASGsi28bk,121
168
- sempy_labs/tom/_model.py,sha256=mZ6vCdngYFgDApcAmAZMnvJCYha3KyJOT8LidlguOKs,178793
169
- semantic_link_labs-0.9.3.dist-info/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
170
- semantic_link_labs-0.9.3.dist-info/METADATA,sha256=cwDtUO5grMFH9sHRkgjnII90UfveA5VAldDKm8PGmOs,24748
171
- semantic_link_labs-0.9.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
172
- semantic_link_labs-0.9.3.dist-info/top_level.txt,sha256=kiQX1y42Dbein1l3Q8jMUYyRulDjdlc2tMepvtrvixQ,11
173
- semantic_link_labs-0.9.3.dist-info/RECORD,,
184
+ sempy_labs/tom/_model.py,sha256=uQXCiaym-00LNxGLVEUMb5VyhBXL2Hd59bIGnWtle08,189080
185
+ semantic_link_labs-0.9.5.dist-info/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
186
+ semantic_link_labs-0.9.5.dist-info/METADATA,sha256=e0OiZ-sSGgLcn2UMrpp-1QzGCtAje51zx8DSXT3bwEc,25981
187
+ semantic_link_labs-0.9.5.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
188
+ semantic_link_labs-0.9.5.dist-info/top_level.txt,sha256=kiQX1y42Dbein1l3Q8jMUYyRulDjdlc2tMepvtrvixQ,11
189
+ semantic_link_labs-0.9.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
sempy_labs/__init__.py CHANGED
@@ -1,3 +1,13 @@
1
+ from sempy_labs._mounted_data_factories import (
2
+ list_mounted_data_factories,
3
+ get_mounted_data_factory_definition,
4
+ delete_mounted_data_factory,
5
+ )
6
+
7
+ from sempy_labs._semantic_models import (
8
+ get_semantic_model_refresh_schedule,
9
+ enable_semantic_model_scheduled_refresh,
10
+ )
1
11
  from sempy_labs._graphQL import (
2
12
  list_graphql_apis,
3
13
  create_graphql_api,
@@ -5,8 +15,14 @@ from sempy_labs._graphQL import (
5
15
  from sempy_labs._job_scheduler import (
6
16
  list_item_job_instances,
7
17
  list_item_schedules,
18
+ create_item_schedule_cron,
19
+ create_item_schedule_daily,
20
+ create_item_schedule_weekly,
21
+ )
22
+ from sempy_labs._delta_analyzer import (
23
+ delta_analyzer,
24
+ get_delta_table_history,
8
25
  )
9
- from sempy_labs._delta_analyzer import delta_analyzer
10
26
  from sempy_labs._gateways import (
11
27
  list_gateway_members,
12
28
  list_gateway_role_assigments,
@@ -75,6 +91,7 @@ from sempy_labs._eventhouses import (
75
91
  create_eventhouse,
76
92
  list_eventhouses,
77
93
  delete_eventhouse,
94
+ get_eventhouse_definition,
78
95
  )
79
96
  from sempy_labs._eventstreams import (
80
97
  list_eventstreams,
@@ -88,7 +105,7 @@ from sempy_labs._kql_querysets import (
88
105
  )
89
106
  from sempy_labs._kql_databases import (
90
107
  list_kql_databases,
91
- create_kql_database,
108
+ # create_kql_database,
92
109
  delete_kql_database,
93
110
  )
94
111
  from sempy_labs._mirrored_warehouses import list_mirrored_warehouses
@@ -158,6 +175,11 @@ from sempy_labs._notebooks import (
158
175
  from sempy_labs._sql import (
159
176
  ConnectWarehouse,
160
177
  ConnectLakehouse,
178
+ ConnectSQLDatabase,
179
+ )
180
+ from sempy_labs._sqldatabase import (
181
+ get_sql_database_columns,
182
+ get_sql_database_tables,
161
183
  )
162
184
  from sempy_labs._workspace_identity import (
163
185
  provision_workspace_identity,
@@ -177,6 +199,8 @@ from sempy_labs._git import (
177
199
  connect_workspace_to_azure_dev_ops,
178
200
  connect_workspace_to_github,
179
201
  disconnect_workspace_from_git,
202
+ get_my_git_credentials,
203
+ update_my_git_credentials,
180
204
  )
181
205
  from sempy_labs._dataflows import (
182
206
  list_dataflow_storage_accounts,
@@ -210,6 +234,9 @@ from sempy_labs._generate_semantic_model import (
210
234
  update_semantic_model_from_bim,
211
235
  get_semantic_model_definition,
212
236
  )
237
+ from sempy_labs._dashboards import (
238
+ list_dashboards,
239
+ )
213
240
  from sempy_labs._list_functions import (
214
241
  list_reports_using_semantic_model,
215
242
  list_semantic_model_object_report_usage,
@@ -218,7 +245,6 @@ from sempy_labs._list_functions import (
218
245
  list_shortcuts,
219
246
  get_object_level_security,
220
247
  list_capacities,
221
- list_dashboards,
222
248
  list_datamarts,
223
249
  list_lakehouses,
224
250
  list_sql_endpoints,
@@ -291,6 +317,7 @@ __all__ = [
291
317
  "resolve_warehouse_id",
292
318
  "ConnectWarehouse",
293
319
  "ConnectLakehouse",
320
+ "ConnectSQLDatabase",
294
321
  "update_semantic_model_from_bim",
295
322
  "list_connections",
296
323
  "get_semantic_model_size",
@@ -408,7 +435,7 @@ __all__ = [
408
435
  "convert_to_friendly_case",
409
436
  "list_mirrored_warehouses",
410
437
  "list_kql_databases",
411
- "create_kql_database",
438
+ # "create_kql_database",
412
439
  "delete_kql_database",
413
440
  "create_eventhouse",
414
441
  "list_eventhouses",
@@ -499,4 +526,18 @@ __all__ = [
499
526
  "delta_analyzer",
500
527
  # "dax_perf_test",
501
528
  # "dax_perf_test_bulk",
529
+ "get_semantic_model_refresh_schedule",
530
+ "get_eventhouse_definition",
531
+ "enable_semantic_model_scheduled_refresh",
532
+ "get_delta_table_history",
533
+ "get_sql_database_columns",
534
+ "get_sql_database_tables",
535
+ "create_item_schedule_cron",
536
+ "create_item_schedule_daily",
537
+ "create_item_schedule_weekly",
538
+ "get_my_git_credentials",
539
+ "update_my_git_credentials",
540
+ "list_mounted_data_factories",
541
+ "get_mounted_data_factory_definition",
542
+ "delete_mounted_data_factory",
502
543
  ]
sempy_labs/_capacities.py CHANGED
@@ -256,7 +256,6 @@ def suspend_fabric_capacity(
256
256
  capacity_name: str,
257
257
  azure_subscription_id: str,
258
258
  resource_group: str,
259
- **kwargs,
260
259
  ):
261
260
  """
262
261
  This function suspends a Fabric capacity.
@@ -275,26 +274,9 @@ def suspend_fabric_capacity(
275
274
  The name of the Azure resource group.
276
275
  """
277
276
 
278
- token_provider = auth.token_provider.get()
279
- if token_provider is None:
280
- token_provider = ServicePrincipalTokenProvider.from_azure_key_vault(
281
- key_vault_uri=kwargs["key_vault_uri"],
282
- key_vault_tenant_id=kwargs["key_vault_tenant_id"],
283
- key_vault_client_id=kwargs["key_vault_client_id"],
284
- key_vault_client_secret=kwargs["key_vault_client_secret"],
285
- )
286
- print(
287
- f"{icons.info} Please use the 'token_provider' parameter instead of the key vault parameters within this function as the key vault parameters have been deprecated."
288
- )
289
-
290
- headers = _get_headers(token_provider, audience="azure")
291
-
292
277
  url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Fabric/capacities/{capacity_name}/suspend?api-version={icons.azure_api_version}"
293
278
 
294
- response = requests.post(url, headers=headers)
295
-
296
- if response.status_code != 202:
297
- raise FabricHTTPException(response)
279
+ _base_api(request=url, client="azure", method="post", status_codes=202)
298
280
 
299
281
  print(f"{icons.green_dot} The '{capacity_name}' capacity has been suspended.")
300
282
 
@@ -304,7 +286,6 @@ def resume_fabric_capacity(
304
286
  capacity_name: str,
305
287
  azure_subscription_id: str,
306
288
  resource_group: str,
307
- **kwargs,
308
289
  ):
309
290
  """
310
291
  This function resumes a Fabric capacity.
@@ -323,26 +304,9 @@ def resume_fabric_capacity(
323
304
  The name of the Azure resource group.
324
305
  """
325
306
 
326
- token_provider = auth.token_provider.get()
327
- if token_provider is None:
328
- token_provider = ServicePrincipalTokenProvider.from_azure_key_vault(
329
- key_vault_uri=kwargs["key_vault_uri"],
330
- key_vault_tenant_id=kwargs["key_vault_tenant_id"],
331
- key_vault_client_id=kwargs["key_vault_client_id"],
332
- key_vault_client_secret=kwargs["key_vault_client_secret"],
333
- )
334
- print(
335
- f"{icons.info} Please use the 'token_provider' parameter instead of the key vault parameters within this function as the key vault parameters have been deprecated."
336
- )
337
-
338
- headers = _get_headers(token_provider, audience="azure")
339
-
340
307
  url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Fabric/capacities/{capacity_name}/resume?api-version={icons.azure_api_version}"
341
308
 
342
- response = requests.post(url, headers=headers)
343
-
344
- if response.status_code != 202:
345
- raise FabricHTTPException(response)
309
+ _base_api(request=url, client="azure", method="post", status_codes=202)
346
310
 
347
311
  print(f"{icons.green_dot} The '{capacity_name}' capacity has been resumed.")
348
312
 
@@ -352,7 +316,6 @@ def delete_embedded_capacity(
352
316
  capacity_name: str,
353
317
  azure_subscription_id: str,
354
318
  resource_group: str,
355
- **kwargs,
356
319
  ):
357
320
  """
358
321
  This function deletes a Power BI Embedded capacity.
@@ -369,53 +332,36 @@ def delete_embedded_capacity(
369
332
  The name of the Azure resource group.
370
333
  """
371
334
 
372
- token_provider = auth.token_provider.get()
373
- if token_provider is None:
374
- token_provider = ServicePrincipalTokenProvider.from_azure_key_vault(
375
- key_vault_uri=kwargs["key_vault_uri"],
376
- key_vault_tenant_id=kwargs["key_vault_tenant_id"],
377
- key_vault_client_id=kwargs["key_vault_client_id"],
378
- key_vault_client_secret=kwargs["key_vault_client_secret"],
379
- )
380
- print(
381
- f"{icons.info} Please use the 'token_provider' parameter instead of the key vault parameters within this function as the key vault parameters have been deprecated."
382
- )
383
-
384
- headers = _get_headers(token_provider, audience="azure")
385
-
386
335
  url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.PowerBIDedicated/capacities/{capacity_name}?api-version={icons.azure_api_version}"
387
336
 
388
- response = requests.delete(url, headers=headers)
389
-
390
- if response.status_code not in [200, 202]:
391
- raise FabricHTTPException(response)
337
+ _base_api(request=url, client="azure", method="delete", status_codes=[200, 202])
392
338
 
393
339
  print(f"{icons.green_dot} The '{capacity_name}' capacity has been deleted.")
394
340
 
395
341
 
396
342
  @log
397
- def delete_premium_capacity(capacity_name: str):
343
+ def delete_premium_capacity(capacity: str | UUID, **kwargs):
398
344
  """
399
345
  This function deletes a Power BI Premium capacity.
400
346
 
401
347
  Parameters
402
348
  ----------
403
- capacity_name : str
404
- Name of the Fabric capacity.
349
+ capacity : str | uuid.UUID
350
+ Name or ID of the Fabric capacity.
405
351
  """
352
+ from sempy_labs._helper_functions import resolve_capacity_id
406
353
 
407
- dfC = fabric.list_capacities()
408
-
409
- dfC_filt = dfC[dfC["Display Name"] == capacity_name]
410
- if len(dfC_filt) == 0:
411
- raise ValueError(
412
- f"{icons.red_dot} The '{capacity_name}' capacity does not exist."
354
+ if "capacity_name" in kwargs:
355
+ capacity = kwargs["capacity_name"]
356
+ print(
357
+ f"{icons.warning} The 'capacity_name' parameter is deprecated. Please use 'capacity' instead."
413
358
  )
414
- capacity_id = dfC_filt["Id"].iloc[0].upper()
359
+
360
+ capacity_id = resolve_capacity_id(capacity=capacity).upper()
415
361
 
416
362
  _base_api(request=f"capacities/{capacity_id}", method="delete", status_codes=204)
417
363
 
418
- print(f"{icons.green_dot} The '{capacity_name}' capacity has been deleted.")
364
+ print(f"{icons.green_dot} The '{capacity}' capacity has been deleted.")
419
365
 
420
366
 
421
367
  @log
@@ -423,7 +369,6 @@ def delete_fabric_capacity(
423
369
  capacity_name: str,
424
370
  azure_subscription_id: str,
425
371
  resource_group: str,
426
- **kwargs,
427
372
  ):
428
373
  """
429
374
  This function deletes a Fabric capacity.
@@ -442,26 +387,9 @@ def delete_fabric_capacity(
442
387
  The name of the Azure resource group.
443
388
  """
444
389
 
445
- token_provider = auth.token_provider.get()
446
- if token_provider is None:
447
- token_provider = ServicePrincipalTokenProvider.from_azure_key_vault(
448
- key_vault_uri=kwargs["key_vault_uri"],
449
- key_vault_tenant_id=kwargs["key_vault_tenant_id"],
450
- key_vault_client_id=kwargs["key_vault_client_id"],
451
- key_vault_client_secret=kwargs["key_vault_client_secret"],
452
- )
453
- print(
454
- f"{icons.info} Please use the 'token_provider' parameter instead of the key vault parameters within this function as the key vault parameters have been deprecated."
455
- )
456
-
457
- headers = _get_headers(token_provider, audience="azure")
458
-
459
390
  url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Fabric/capacities/{capacity_name}?api-version={icons.azure_api_version}"
460
391
 
461
- response = requests.delete(url, headers=headers)
462
-
463
- if response.status_code != 202:
464
- raise FabricHTTPException(response)
392
+ _base_api(request=url, client="azure", method="delete", status_codes=202)
465
393
 
466
394
  print(f"{icons.green_dot} The '{capacity_name}' capacity has been deleted.")
467
395
 
@@ -474,7 +402,6 @@ def update_fabric_capacity(
474
402
  sku: Optional[str] = None,
475
403
  admin_members: Optional[str | List[str]] = None,
476
404
  tags: Optional[dict] = None,
477
- **kwargs,
478
405
  ):
479
406
  """
480
407
  This function updates a Fabric capacity's properties.
@@ -499,25 +426,9 @@ def update_fabric_capacity(
499
426
  Tag(s) to add to the capacity. Example: {'tagName': 'tagValue'}.
500
427
  """
501
428
 
502
- token_provider = auth.token_provider.get()
503
- if token_provider is None:
504
- token_provider = ServicePrincipalTokenProvider.from_azure_key_vault(
505
- key_vault_uri=kwargs["key_vault_uri"],
506
- key_vault_tenant_id=kwargs["key_vault_tenant_id"],
507
- key_vault_client_id=kwargs["key_vault_client_id"],
508
- key_vault_client_secret=kwargs["key_vault_client_secret"],
509
- )
510
- print(
511
- f"{icons.info} Please use the 'token_provider' parameter instead of the key vault parameters within this function as the key vault parameters have been deprecated."
512
- )
513
-
514
- headers = _get_headers(token_provider, audience="azure")
515
-
516
429
  url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Fabric/capacities/{capacity_name}?api-version={icons.azure_api_version}"
517
430
 
518
- get_response = requests.get(url, headers=headers)
519
- if get_response.status_code != 200:
520
- raise FabricHTTPException(get_response)
431
+ get_response = _base_api(request=url, client="azure")
521
432
 
522
433
  get_json = get_response.json()
523
434
  current_sku = get_json.get("sku", {}).get("name")
@@ -549,10 +460,9 @@ def update_fabric_capacity(
549
460
  return
550
461
 
551
462
  payload = _add_sll_tag(payload, tags)
552
- response = requests.patch(url, headers=headers, json=payload)
553
-
554
- if response.status_code != 202:
555
- raise FabricHTTPException(response)
463
+ _base_api(
464
+ request=url, client="azure", method="patch", payload=payload, status_codes=202
465
+ )
556
466
 
557
467
  print(
558
468
  f"{icons.green_dot} The '{capacity_name}' capacity has been updated accordingly."
@@ -588,28 +498,13 @@ def check_fabric_capacity_name_availablility(
588
498
  An indication as to whether the Fabric capacity name is available or not.
589
499
  """
590
500
 
591
- token_provider = auth.token_provider.get()
592
- if token_provider is None:
593
- token_provider = ServicePrincipalTokenProvider.from_azure_key_vault(
594
- key_vault_uri=kwargs["key_vault_uri"],
595
- key_vault_tenant_id=kwargs["key_vault_tenant_id"],
596
- key_vault_client_id=kwargs["key_vault_client_id"],
597
- key_vault_client_secret=kwargs["key_vault_client_secret"],
598
- )
599
- print(
600
- f"{icons.info} Please use the 'token_provider' parameter instead of the key vault parameters within this function as the key vault parameters have been deprecated."
601
- )
602
-
603
- headers = _get_headers(token_provider, audience="azure")
604
-
605
501
  payload = {"name": capacity_name, "type": "Microsoft.Fabric/capacities"}
606
502
 
607
503
  url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/providers/Microsoft.Fabric/locations/{region}/checkNameAvailability?api-version={icons.azure_api_version}"
608
504
 
609
- response = requests.post(url, headers=headers, json=payload)
610
-
611
- if response.status_code != 202:
612
- raise FabricHTTPException(response)
505
+ response = _base_api(
506
+ request=url, client="azure", method="post", payload=payload, status_codes=202
507
+ )
613
508
 
614
509
  return bool(response.json().get("nameAvailable"))
615
510