semantic-link-labs 0.9.4__py3-none-any.whl → 0.9.6__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.9.4.dist-info → semantic_link_labs-0.9.6.dist-info}/METADATA +19 -2
- {semantic_link_labs-0.9.4.dist-info → semantic_link_labs-0.9.6.dist-info}/RECORD +71 -64
- {semantic_link_labs-0.9.4.dist-info → semantic_link_labs-0.9.6.dist-info}/WHEEL +1 -1
- sempy_labs/__init__.py +33 -4
- sempy_labs/_capacities.py +59 -128
- sempy_labs/_capacity_migration.py +19 -21
- sempy_labs/_connections.py +2 -4
- sempy_labs/_dashboards.py +60 -0
- sempy_labs/_data_pipelines.py +5 -31
- sempy_labs/_dataflows.py +2 -2
- sempy_labs/_dax_query_view.py +55 -0
- sempy_labs/_delta_analyzer.py +16 -14
- sempy_labs/_environments.py +28 -49
- sempy_labs/_eventhouses.py +27 -53
- sempy_labs/_eventstreams.py +16 -34
- sempy_labs/_external_data_shares.py +4 -10
- sempy_labs/_gateways.py +4 -4
- sempy_labs/_generate_semantic_model.py +2 -2
- sempy_labs/_git.py +90 -1
- sempy_labs/_graphQL.py +8 -21
- sempy_labs/_helper_functions.py +440 -91
- sempy_labs/_kql_databases.py +24 -35
- sempy_labs/_kql_querysets.py +15 -32
- sempy_labs/_list_functions.py +17 -192
- sempy_labs/_managed_private_endpoints.py +9 -2
- sempy_labs/_mirrored_databases.py +17 -49
- sempy_labs/_ml_experiments.py +6 -31
- sempy_labs/_ml_models.py +4 -28
- sempy_labs/_model_bpa.py +4 -11
- sempy_labs/_model_bpa_bulk.py +23 -27
- sempy_labs/_mounted_data_factories.py +119 -0
- sempy_labs/_notebooks.py +16 -26
- sempy_labs/_one_lake_integration.py +2 -1
- sempy_labs/_semantic_models.py +20 -0
- sempy_labs/_sql.py +13 -8
- sempy_labs/_sqldatabase.py +61 -100
- sempy_labs/_utils.py +42 -0
- sempy_labs/_vertipaq.py +25 -13
- sempy_labs/_warehouses.py +19 -20
- sempy_labs/_workloads.py +23 -9
- sempy_labs/_workspace_identity.py +6 -0
- sempy_labs/_workspaces.py +55 -7
- sempy_labs/admin/__init__.py +21 -1
- sempy_labs/admin/_apps.py +1 -1
- sempy_labs/admin/_artifacts.py +62 -0
- sempy_labs/admin/_basic_functions.py +3 -54
- sempy_labs/admin/_capacities.py +61 -0
- sempy_labs/admin/_reports.py +74 -0
- sempy_labs/admin/_scanner.py +2 -2
- sempy_labs/admin/_shared.py +4 -2
- sempy_labs/admin/_users.py +133 -0
- sempy_labs/admin/_workspaces.py +148 -0
- sempy_labs/directlake/_directlake_schema_compare.py +2 -1
- sempy_labs/directlake/_directlake_schema_sync.py +65 -19
- sempy_labs/directlake/_dl_helper.py +0 -6
- sempy_labs/directlake/_generate_shared_expression.py +10 -11
- sempy_labs/directlake/_guardrails.py +2 -1
- sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py +12 -25
- sempy_labs/directlake/_update_directlake_partition_entity.py +11 -3
- sempy_labs/lakehouse/__init__.py +2 -0
- sempy_labs/lakehouse/_lakehouse.py +6 -7
- sempy_labs/lakehouse/_shortcuts.py +198 -57
- sempy_labs/migration/_migration_validation.py +0 -4
- sempy_labs/report/_download_report.py +4 -6
- sempy_labs/report/_generate_report.py +15 -23
- sempy_labs/report/_report_bpa.py +12 -19
- sempy_labs/report/_report_functions.py +2 -1
- sempy_labs/report/_report_rebind.py +8 -6
- sempy_labs/tom/_model.py +34 -16
- {semantic_link_labs-0.9.4.dist-info → semantic_link_labs-0.9.6.dist-info}/LICENSE +0 -0
- {semantic_link_labs-0.9.4.dist-info → semantic_link_labs-0.9.6.dist-info}/top_level.txt +0 -0
sempy_labs/tom/_model.py
CHANGED
|
@@ -1172,8 +1172,8 @@ class TOMWrapper:
|
|
|
1172
1172
|
Name of the table.
|
|
1173
1173
|
entity_name : str
|
|
1174
1174
|
Name of the lakehouse/warehouse table.
|
|
1175
|
-
expression :
|
|
1176
|
-
The expression used by the
|
|
1175
|
+
expression : str, default=None
|
|
1176
|
+
The name of the expression used by the partition.
|
|
1177
1177
|
Defaults to None which resolves to the 'DatabaseQuery' expression.
|
|
1178
1178
|
description : str, default=None
|
|
1179
1179
|
A description for the partition.
|
|
@@ -1543,6 +1543,7 @@ class TOMWrapper:
|
|
|
1543
1543
|
self,
|
|
1544
1544
|
object: Union["TOM.Table", "TOM.Column", "TOM.Measure", "TOM.Hierarchy"],
|
|
1545
1545
|
perspective_name: str,
|
|
1546
|
+
include_all: bool = True,
|
|
1546
1547
|
):
|
|
1547
1548
|
"""
|
|
1548
1549
|
Adds an object to a `perspective <https://learn.microsoft.com/dotnet/api/microsoft.analysisservices.perspective?view=analysisservices-dotnet>`_.
|
|
@@ -1553,6 +1554,8 @@ class TOMWrapper:
|
|
|
1553
1554
|
An object (i.e. table/column/measure) within a semantic model.
|
|
1554
1555
|
perspective_name : str
|
|
1555
1556
|
Name of the perspective.
|
|
1557
|
+
include_all : bool, default=True
|
|
1558
|
+
Relevant to tables only, if set to True, includes all columns, measures, and hierarchies within that table in the perspective.
|
|
1556
1559
|
"""
|
|
1557
1560
|
import Microsoft.AnalysisServices.Tabular as TOM
|
|
1558
1561
|
|
|
@@ -1578,6 +1581,8 @@ class TOMWrapper:
|
|
|
1578
1581
|
|
|
1579
1582
|
if objectType == TOM.ObjectType.Table:
|
|
1580
1583
|
pt = TOM.PerspectiveTable()
|
|
1584
|
+
if include_all:
|
|
1585
|
+
pt.IncludeAll = True
|
|
1581
1586
|
pt.Table = object
|
|
1582
1587
|
object.Model.Perspectives[perspective_name].PerspectiveTables.Add(pt)
|
|
1583
1588
|
elif objectType == TOM.ObjectType.Column:
|
|
@@ -3517,14 +3522,14 @@ class TOMWrapper:
|
|
|
3517
3522
|
|
|
3518
3523
|
return usingView
|
|
3519
3524
|
|
|
3520
|
-
def has_incremental_refresh_policy(self,
|
|
3525
|
+
def has_incremental_refresh_policy(self, object):
|
|
3521
3526
|
"""
|
|
3522
3527
|
Identifies whether a table has an `incremental refresh <https://learn.microsoft.com/power-bi/connect-data/incremental-refresh-overview>`_ policy.
|
|
3523
3528
|
|
|
3524
3529
|
Parameters
|
|
3525
3530
|
----------
|
|
3526
|
-
|
|
3527
|
-
|
|
3531
|
+
object : TOM Object
|
|
3532
|
+
The TOM object within the semantic model. Accepts either a table or the model object.
|
|
3528
3533
|
|
|
3529
3534
|
Returns
|
|
3530
3535
|
-------
|
|
@@ -3532,13 +3537,21 @@ class TOMWrapper:
|
|
|
3532
3537
|
An indicator whether a table has an incremental refresh policy.
|
|
3533
3538
|
"""
|
|
3534
3539
|
|
|
3535
|
-
|
|
3536
|
-
rp = self.model.Tables[table_name].RefreshPolicy
|
|
3537
|
-
|
|
3538
|
-
if rp is not None:
|
|
3539
|
-
hasRP = True
|
|
3540
|
+
import Microsoft.AnalysisServices.Tabular as TOM
|
|
3540
3541
|
|
|
3541
|
-
|
|
3542
|
+
if object.ObjectType == TOM.ObjectType.Table:
|
|
3543
|
+
if object.RefreshPolicy is not None:
|
|
3544
|
+
return True
|
|
3545
|
+
else:
|
|
3546
|
+
return False
|
|
3547
|
+
elif object.ObjectType == TOM.ObjectType.Model:
|
|
3548
|
+
rp = False
|
|
3549
|
+
for t in self.model.Tables:
|
|
3550
|
+
if t.RefreshPolicy is not None:
|
|
3551
|
+
rp = True
|
|
3552
|
+
return rp
|
|
3553
|
+
else:
|
|
3554
|
+
raise NotImplementedError
|
|
3542
3555
|
|
|
3543
3556
|
def show_incremental_refresh_policy(self, table_name: str):
|
|
3544
3557
|
"""
|
|
@@ -4760,17 +4773,20 @@ class TOMWrapper:
|
|
|
4760
4773
|
|
|
4761
4774
|
import Microsoft.AnalysisServices.Tabular as TOM
|
|
4762
4775
|
|
|
4763
|
-
|
|
4776
|
+
bim = (
|
|
4764
4777
|
json.loads(TOM.JsonScripter.ScriptCreate(self.model.Database))
|
|
4765
4778
|
.get("create")
|
|
4766
4779
|
.get("database")
|
|
4767
4780
|
)
|
|
4768
4781
|
|
|
4782
|
+
return bim
|
|
4783
|
+
|
|
4769
4784
|
def _reduce_model(self, perspective_name: str):
|
|
4770
4785
|
"""
|
|
4771
4786
|
Reduces a model's objects based on a perspective. Adds the dependent objects within a perspective to that perspective.
|
|
4772
4787
|
"""
|
|
4773
4788
|
|
|
4789
|
+
import Microsoft.AnalysisServices.Tabular as TOM
|
|
4774
4790
|
from sempy_labs._model_dependencies import get_model_calc_dependencies
|
|
4775
4791
|
|
|
4776
4792
|
fabric.refresh_tom_cache(workspace=self._workspace_id)
|
|
@@ -4852,7 +4868,7 @@ class TOMWrapper:
|
|
|
4852
4868
|
object=obj, perspective_name=perspective_name
|
|
4853
4869
|
):
|
|
4854
4870
|
self.add_to_perspective(
|
|
4855
|
-
object=obj, perspective_name=perspective_name
|
|
4871
|
+
object=obj, perspective_name=perspective_name, include_all=False
|
|
4856
4872
|
)
|
|
4857
4873
|
added = True
|
|
4858
4874
|
elif obj_type == "Measure":
|
|
@@ -4861,7 +4877,7 @@ class TOMWrapper:
|
|
|
4861
4877
|
object=obj, perspective_name=perspective_name
|
|
4862
4878
|
):
|
|
4863
4879
|
self.add_to_perspective(
|
|
4864
|
-
object=obj, perspective_name=perspective_name
|
|
4880
|
+
object=obj, perspective_name=perspective_name, include_all=False
|
|
4865
4881
|
)
|
|
4866
4882
|
added = True
|
|
4867
4883
|
elif obj_type == "Table":
|
|
@@ -4870,7 +4886,7 @@ class TOMWrapper:
|
|
|
4870
4886
|
object=obj, perspective_name=perspective_name
|
|
4871
4887
|
):
|
|
4872
4888
|
self.add_to_perspective(
|
|
4873
|
-
object=obj, perspective_name=perspective_name
|
|
4889
|
+
object=obj, perspective_name=perspective_name, include_all=False
|
|
4874
4890
|
)
|
|
4875
4891
|
added = True
|
|
4876
4892
|
if added:
|
|
@@ -4917,7 +4933,9 @@ class TOMWrapper:
|
|
|
4917
4933
|
else:
|
|
4918
4934
|
for attr in ["Columns", "Measures", "Hierarchies"]:
|
|
4919
4935
|
for obj in getattr(t, attr):
|
|
4920
|
-
if
|
|
4936
|
+
if attr == "Columns" and obj.Type == TOM.ColumnType.RowNumber:
|
|
4937
|
+
pass
|
|
4938
|
+
elif not self.in_perspective(
|
|
4921
4939
|
object=obj, perspective_name=perspective_name
|
|
4922
4940
|
):
|
|
4923
4941
|
self.remove_object(object=obj)
|
|
File without changes
|
|
File without changes
|