semantic-link-labs 0.4.1__tar.gz → 0.5.0__tar.gz
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.5.0/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- semantic_link_labs-0.5.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- semantic_link_labs-0.5.0/.github/ISSUE_TEMPLATE/issue--question---advice-needed.md +14 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/.github/workflows/build.yaml +0 -9
- semantic_link_labs-0.5.0/.github/workflows/codeql.yaml +30 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/PKG-INFO +1 -1
- semantic_link_labs-0.5.0/README.md +121 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/docs/requirements.txt +2 -1
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/docs/source/conf.py +1 -1
- semantic_link_labs-0.5.0/notebooks/Migration to Direct Lake.ipynb +1 -0
- semantic_link_labs-0.5.0/notebooks/Model Optimization.ipynb +1 -0
- semantic_link_labs-0.5.0/notebooks/Query Scale Out.ipynb +1 -0
- semantic_link_labs-0.5.0/notebooks/Tabular Object Model.ipynb +1 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/pyproject.toml +5 -2
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/semantic_link_labs.egg-info/PKG-INFO +1 -1
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/semantic_link_labs.egg-info/SOURCES.txt +6 -1
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/__init__.py +51 -27
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_ai.py +32 -51
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_clear_cache.py +2 -3
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_connections.py +39 -38
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_dax.py +5 -9
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_generate_semantic_model.py +15 -21
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_helper_functions.py +20 -25
- semantic_link_labs-0.5.0/src/sempy_labs/_icons.py +10 -0
- semantic_link_labs-0.5.0/src/sempy_labs/_list_functions.py +2152 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_model_auto_build.py +3 -5
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_model_bpa.py +20 -24
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_model_dependencies.py +7 -14
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_one_lake_integration.py +14 -24
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_query_scale_out.py +13 -31
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_refresh_semantic_model.py +8 -18
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_translations.py +5 -5
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/_vertipaq.py +11 -18
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_directlake_schema_compare.py +11 -15
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_directlake_schema_sync.py +35 -40
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_fallback.py +3 -7
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_get_directlake_lakehouse.py +3 -4
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_get_shared_expression.py +5 -11
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_guardrails.py +5 -7
- semantic_link_labs-0.5.0/src/sempy_labs/directlake/_list_directlake_model_calc_tables.py +56 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_show_unsupported_directlake_objects.py +3 -4
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py +11 -16
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_update_directlake_partition_entity.py +25 -15
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/_warm_cache.py +10 -15
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/lakehouse/__init__.py +0 -2
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/lakehouse/_get_lakehouse_columns.py +4 -3
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/lakehouse/_get_lakehouse_tables.py +12 -11
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/lakehouse/_lakehouse.py +6 -7
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/lakehouse/_shortcuts.py +10 -111
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/__init__.py +4 -2
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/_create_pqt_file.py +5 -14
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/_migrate_calctables_to_lakehouse.py +7 -7
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/_migrate_calctables_to_semantic_model.py +4 -4
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/_migrate_model_objects_to_semantic_model.py +3 -8
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/_migrate_tables_columns_to_semantic_model.py +6 -6
- semantic_link_labs-0.5.0/src/sempy_labs/migration/_migration_validation.py +68 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/migration/_refresh_calc_tables.py +5 -5
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/report/__init__.py +2 -2
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/report/_generate_report.py +14 -19
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/report/_report_functions.py +41 -83
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/report/_report_rebind.py +43 -44
- semantic_link_labs-0.5.0/src/sempy_labs/tom/__init__.py +6 -0
- semantic_link_labs-0.4.1/src/sempy_labs/_tom.py → semantic_link_labs-0.5.0/src/sempy_labs/tom/_model.py +274 -337
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/tests/test_tom.py +1 -1
- semantic_link_labs-0.4.1/README.md +0 -289
- semantic_link_labs-0.4.1/notebooks/Migration to Direct Lake.ipynb +0 -1
- semantic_link_labs-0.4.1/notebooks/Model Optimization.ipynb +0 -1
- semantic_link_labs-0.4.1/notebooks/Query Scale Out.ipynb +0 -1
- semantic_link_labs-0.4.1/notebooks/Tabular Object Model.ipynb +0 -1
- semantic_link_labs-0.4.1/src/sempy_labs/_icons.py +0 -4
- semantic_link_labs-0.4.1/src/sempy_labs/_list_functions.py +0 -1372
- semantic_link_labs-0.4.1/src/sempy_labs/directlake/_list_directlake_model_calc_tables.py +0 -54
- semantic_link_labs-0.4.1/src/sempy_labs/migration/_migration_validation.py +0 -227
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/.gitignore +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/.readthedocs.yaml +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/.vscode/settings.json +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/CODE_OF_CONDUCT.md +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/LICENSE +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/SECURITY.md +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/SUPPORT.md +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/docs/Makefile +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/docs/make.bat +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/docs/source/index.rst +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/docs/source/modules.rst +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/environment.yml +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/setup.cfg +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/semantic_link_labs.egg-info/dependency_links.txt +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/semantic_link_labs.egg-info/requires.txt +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/semantic_link_labs.egg-info/top_level.txt +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/sempy_labs/directlake/__init__.py +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/tests/__init__.py +0 -0
- {semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/tests/test_shortcuts.py +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Additional context**
|
|
32
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'Issue: Question / Advice needed'
|
|
3
|
+
about: Ask a question about this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: question
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**What are you trying to achieve?**
|
|
11
|
+
Provide a brief background description of the problem you're trying to solve. Include information about the semantic engine you're working on (Power BI Desktop, Azure Analysis Services, etc.), as not everything is possible across engines.
|
|
12
|
+
|
|
13
|
+
**What have you tried so far?**
|
|
14
|
+
If applicable, describe the steps you have tried so far. For scripting-related questions, show the code that you have written.
|
|
@@ -4,7 +4,6 @@ on: [push]
|
|
|
4
4
|
|
|
5
5
|
permissions:
|
|
6
6
|
contents: write # This is required for actions/checkout@v1
|
|
7
|
-
security-events: write # To upload sarif files
|
|
8
7
|
|
|
9
8
|
jobs:
|
|
10
9
|
build:
|
|
@@ -17,14 +16,6 @@ jobs:
|
|
|
17
16
|
with:
|
|
18
17
|
python-version: "3.10"
|
|
19
18
|
|
|
20
|
-
- name: Initialize CodeQL
|
|
21
|
-
uses: github/codeql-action/init@v3
|
|
22
|
-
with:
|
|
23
|
-
languages: python
|
|
24
|
-
|
|
25
|
-
- name: Perform CodeQL Analysis
|
|
26
|
-
uses: github/codeql-action/analyze@v3
|
|
27
|
-
|
|
28
19
|
- name: Get Date
|
|
29
20
|
id: get-date
|
|
30
21
|
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
branches: [main]
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: '20 14 * * 1'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
actions: read
|
|
11
|
+
contents: read
|
|
12
|
+
security-events: write # To upload sarif files
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
analyze:
|
|
16
|
+
name: Analyze
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v3
|
|
21
|
+
|
|
22
|
+
- name: Initialize CodeQL
|
|
23
|
+
uses: github/codeql-action/init@v3
|
|
24
|
+
with:
|
|
25
|
+
languages: python
|
|
26
|
+
|
|
27
|
+
- name: Perform CodeQL Analysis
|
|
28
|
+
uses: github/codeql-action/analyze@v3
|
|
29
|
+
|
|
30
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# [semantic-link-labs](https://semantic-link-labs.readthedocs.io/en/0.5.0/)
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/semantic-link-labs)
|
|
4
|
+
[](https://readthedocs.org/projects/semantic-link-labs/)
|
|
5
|
+
[](https://github.com/psf/black)
|
|
6
|
+
[](https://pepy.tech/project/semantic-link-labs)
|
|
7
|
+
|
|
8
|
+
All functions in this library are documented [here](https://semantic-link-labs.readthedocs.io/en/0.5.0/)!
|
|
9
|
+
|
|
10
|
+
This is a python library intended to be used in [Microsoft Fabric notebooks](https://learn.microsoft.com/fabric/data-engineering/how-to-use-notebook). This library was originally intended to contain functions used for [migrating semantic models to Direct Lake mode](https://github.com/microsoft/semantic-link-labs?tab=readme-ov-file#direct-lake-migration). However, it quickly became apparent that functions within such a library could support many other useful activities in the realm of semantic models, reports, lakehouses and really anything Fabric-related. As such, this library contains a variety of functions ranging from running [Vertipaq Analyzer](https://semantic-link-labs.readthedocs.io/en/0.5.0/sempy_labs.html#sempy_labs.import_vertipaq_analyzer) or the [Best Practice Analyzer](https://semantic-link-labs.readthedocs.io/en/0.5.0/sempy_labs.html#sempy_labs.run_model_bpa) against a semantic model to seeing if any [lakehouse tables hit Direct Lake guardrails](https://semantic-link-labs.readthedocs.io/en/0.5.0/sempy_labs.lakehouse.html#sempy_labs.lakehouse.get_lakehouse_tables) or accessing the [Tabular Object Model](https://semantic-link-labs.readthedocs.io/en/0.5.0/sempy_labs.tom.html) and more!
|
|
11
|
+
|
|
12
|
+
Instructions for migrating import/DirectQuery semantic models to Direct Lake mode can be found [here](https://github.com/microsoft/semantic-link-labs?tab=readme-ov-file#direct-lake-migration).
|
|
13
|
+
|
|
14
|
+
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=).
|
|
15
|
+
|
|
16
|
+
If you have ideas for new features/functions, please [request a feature](https://github.com/microsoft/semantic-link-labs/issues/new?assignees=&labels=&projects=&template=feature_request.md&title=).
|
|
17
|
+
|
|
18
|
+
## [Function documentation](https://semantic-link-labs.readthedocs.io/en/0.5.0/)
|
|
19
|
+
|
|
20
|
+
## Install the library in a Fabric notebook
|
|
21
|
+
```python
|
|
22
|
+
%pip install semantic-link-labs
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Once installed, run this code to import the library into your notebook
|
|
26
|
+
```python
|
|
27
|
+
import sempy_labs as labs
|
|
28
|
+
from sempy_labs import migration, report, directlake
|
|
29
|
+
from sempy_labs import lakehouse as lake
|
|
30
|
+
from sempy_labs.tom import connect_semantic_model
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Load semantic-link-labs into a custom [Fabric environment](https://learn.microsoft.com/fabric/data-engineering/create-and-use-environment)
|
|
34
|
+
An even better way to ensure the semantic-link-labs library is available in your workspace/notebooks is to load it as a library in a custom Fabric environment. If you do this, you will not have to run the above '%pip install' code every time in your notebook. Please follow the steps below.
|
|
35
|
+
|
|
36
|
+
#### Create a custom environment
|
|
37
|
+
1. Navigate to your Fabric workspace
|
|
38
|
+
2. Click 'New' -> More options
|
|
39
|
+
3. Within 'Data Science', click 'Environment'
|
|
40
|
+
4. Name your environment, click 'Create'
|
|
41
|
+
|
|
42
|
+
#### Add semantic-link-labs as a library to the environment
|
|
43
|
+
1. Within 'Public libraries', click 'Add from PyPI'
|
|
44
|
+
2. Enter 'semantic-link-labs'.
|
|
45
|
+
3. Click 'Save' at the top right of the screen
|
|
46
|
+
4. Click 'Publish' at the top right of the screen
|
|
47
|
+
5. Click 'Publish All'
|
|
48
|
+
|
|
49
|
+
#### Update your notebook to use the new environment (*must wait for the environment to finish publishing*)
|
|
50
|
+
1. Navigate to your Notebook
|
|
51
|
+
2. Select your newly created environment within the 'Environment' drop down in the navigation bar at the top of the notebook
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
## Direct Lake migration
|
|
55
|
+
|
|
56
|
+
The following process automates the migration of an import/DirectQuery model to a new [Direct Lake](https://learn.microsoft.com/power-bi/enterprise/directlake-overview) model. The first step is specifically applicable to models which use Power Query to perform data transformations. If your model does not use Power Query, you must migrate the base tables used in your semantic model to a Fabric lakehouse.
|
|
57
|
+
|
|
58
|
+
Check out [Nikola Ilic](https://twitter.com/DataMozart)'s terrific [blog post](https://data-mozart.com/migrate-existing-power-bi-semantic-models-to-direct-lake-a-step-by-step-guide/) on this topic!
|
|
59
|
+
|
|
60
|
+
Check out my [blog post](https://www.elegantbi.com/post/direct-lake-migration) on this topic!
|
|
61
|
+
|
|
62
|
+
### Prerequisites
|
|
63
|
+
|
|
64
|
+
* Make sure you [enable XMLA Read/Write](https://learn.microsoft.com/power-bi/enterprise/service-premium-connect-tools#enable-xmla-read-write) for your capacity
|
|
65
|
+
* Make sure you have a [lakehouse](https://learn.microsoft.com/fabric/onelake/create-lakehouse-onelake#create-a-lakehouse) in a Fabric workspace
|
|
66
|
+
* Enable the following [setting](https://learn.microsoft.com/power-bi/transform-model/service-edit-data-models#enable-the-preview-feature): Workspace -> Workspace Settings -> General -> Data model settings -> Users can edit data models in the Power BI service
|
|
67
|
+
|
|
68
|
+
### Instructions
|
|
69
|
+
|
|
70
|
+
1. Download this [notebook](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Migration%20to%20Direct%20Lake.ipynb).
|
|
71
|
+
2. Make sure you are in the ['Data Engineering' persona](https://learn.microsoft.com/fabric/get-started/microsoft-fabric-overview#components-of-microsoft-fabric). Click the icon at the bottom left corner of your Workspace screen and select 'Data Engineering'
|
|
72
|
+
3. In your workspace, select 'New -> Import notebook' and import the notebook from step 1.
|
|
73
|
+
4. [Add your lakehouse](https://learn.microsoft.com/fabric/data-engineering/lakehouse-notebook-explore#add-or-remove-a-lakehouse) to your Fabric notebook
|
|
74
|
+
5. Follow the instructions within the notebook.
|
|
75
|
+
|
|
76
|
+
### The migration process
|
|
77
|
+
|
|
78
|
+
> [!NOTE]
|
|
79
|
+
> The first 4 steps are only necessary if you have logic in Power Query. Otherwise, you will need to migrate your semantic model source tables to lakehouse tables.
|
|
80
|
+
|
|
81
|
+
1. The first step of the notebook creates a Power Query Template (.pqt) file which eases the migration of Power Query logic to Dataflows Gen2.
|
|
82
|
+
2. After the .pqt file is created, sync files from your [OneLake file explorer](https://www.microsoft.com/download/details.aspx?id=105222)
|
|
83
|
+
3. Navigate to your lakehouse (this is critical!). From your lakehouse, create a new Dataflows Gen2, and import the Power Query Template file. Doing this step from your lakehouse will automatically set the destination for all tables to this lakehouse (instead of having to manually map each one).
|
|
84
|
+
4. Publish the Dataflow Gen2 and wait for it to finish creating the delta lake tables in your lakehouse.
|
|
85
|
+
5. Back in the notebook, the next step will create your new Direct Lake semantic model with the name of your choice, taking all the relevant properties from the orignal semantic model and refreshing/framing your new semantic model.
|
|
86
|
+
|
|
87
|
+
> [!NOTE]
|
|
88
|
+
> As of version 0.2.1, calculated tables are also migrated to Direct Lake (as data tables with their DAX expression stored as model annotations in the new semantic model). Additionally, Field Parameters are migrated as they were in the original semantic model (as a calculated table).
|
|
89
|
+
|
|
90
|
+
6. Finally, you can easily rebind your all reports which use the import/DQ semantic model to the new Direct Lake semantic model in one click.
|
|
91
|
+
|
|
92
|
+
### Completing these steps will do the following:
|
|
93
|
+
* Offload your Power Query logic to Dataflows Gen2 inside of Fabric (where it can be maintained and development can continue).
|
|
94
|
+
* Dataflows Gen2 will create delta tables in your Fabric lakehouse. These tables can then be used for your Direct Lake model.
|
|
95
|
+
* Create a new semantic model in Direct Lake mode containing all the standard tables and columns, calculation groups, measures, relationships, hierarchies, roles, row level security, perspectives, and translations from your original semantic model.
|
|
96
|
+
* Viable calculated tables are migrated to the new semantic model as data tables. Delta tables are dynamically generated in the lakehouse to support the Direct Lake model. The calculated table DAX logic is stored as model annotations in the new semantic model.
|
|
97
|
+
* Field parameters are migrated to the new semantic model as they were in the original semantic model (as calculated tables). Any calculated columns used in field parameters are automatically removed in the new semantic model's field parameter(s).
|
|
98
|
+
* Non-supported objects are not transferred (i.e. calculated columns, relationships using columns with unsupported data types etc.).
|
|
99
|
+
* Reports used by your original semantic model will be rebinded to your new semantic model.
|
|
100
|
+
|
|
101
|
+
## Contributing
|
|
102
|
+
|
|
103
|
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
104
|
+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
105
|
+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
|
|
106
|
+
|
|
107
|
+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
|
|
108
|
+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
|
|
109
|
+
provided by the bot. You will only need to do this once across all repos using our CLA.
|
|
110
|
+
|
|
111
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
112
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
|
113
|
+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
114
|
+
|
|
115
|
+
## Trademarks
|
|
116
|
+
|
|
117
|
+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
|
|
118
|
+
trademarks or logos is subject to and must follow
|
|
119
|
+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
120
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
121
|
+
Any use of third-party trademarks or logos are subject to those third-party's policies.
|
|
@@ -13,7 +13,7 @@ sys.path.insert(0, os.path.abspath('../../src/'))
|
|
|
13
13
|
project = 'semantic-link-labs'
|
|
14
14
|
copyright = '2024, Microsoft and community'
|
|
15
15
|
author = 'Microsoft and community'
|
|
16
|
-
release = '0.
|
|
16
|
+
release = '0.5.0'
|
|
17
17
|
|
|
18
18
|
# -- General configuration ---------------------------------------------------
|
|
19
19
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"cells":[{"cell_type":"markdown","id":"5c27dfd1-4fe0-4a97-92e6-ddf78889aa93","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Install the latest .whl package\n","\n","Check [here](https://pypi.org/project/semantic-link-labs/) to see the latest version."]},{"cell_type":"code","execution_count":null,"id":"d5cae9db-cef9-48a8-a351-9c5fcc99645c","metadata":{"jupyter":{"outputs_hidden":true,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["%pip install semantic-link-labs"]},{"cell_type":"markdown","id":"969a29bf","metadata":{},"source":["### Import the library and set initial parameters"]},{"cell_type":"code","execution_count":null,"id":"29c923f8","metadata":{},"outputs":[],"source":["import sempy_labs as labs\n","from sempy_labs import migration, report, directlake\n","\n","dataset_name = '' #Enter the import/DQ semantic model name\n","workspace_name = None #Enter the workspace of the import/DQ semantic model. It set to none it will use the current workspace.\n","new_dataset_name = '' #Enter the new Direct Lake semantic model name\n","new_dataset_workspace_name = None #Enter the workspace where the Direct Lake model will be created. If set to None it will use the current workspace.\n","lakehouse_name = None #Enter the lakehouse to be used for the Direct Lake model. If set to None it will use the lakehouse attached to the notebook.\n","lakehouse_workspace_name = None #Enter the lakehouse workspace. If set to None it will use the new_dataset_workspace_name."]},{"cell_type":"markdown","id":"5a3fe6e8-b8aa-4447-812b-7931831e07fe","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Create the [Power Query Template](https://learn.microsoft.com/power-query/power-query-template) file\n","\n","This encapsulates all of the semantic model's Power Query logic into a single file."]},{"cell_type":"code","execution_count":null,"id":"cde43b47-4ecc-46ae-9125-9674819c7eab","metadata":{"jupyter":{"outputs_hidden":false,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["migration.create_pqt_file(dataset = dataset_name, workspace = workspace_name)"]},{"cell_type":"markdown","id":"bf945d07-544c-4934-b7a6-cfdb90ca725e","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Import the Power Query Template to Dataflows Gen2\n","\n","- Open the [OneLake file explorer](https://www.microsoft.com/download/details.aspx?id=105222) and sync your files (right click -> Sync from OneLake)\n","\n","- Navigate to your lakehouse. From this window, create a new Dataflows Gen2 and import the Power Query Template file from OneLake (OneLake -> Workspace -> Lakehouse -> Files...), and publish the Dataflows Gen2.\n","\n","<div class=\"alert alert-block alert-info\">\n","<b>Important!:</b> Make sure to create the Dataflows Gen2 from within the lakehouse window. That will ensure that all the tables automatically map to that lakehouse as the destination. Otherwise, you will have to manually map each table to its destination individually.\n","</div>"]},{"cell_type":"markdown","id":"9975db7d","metadata":{},"source":["### Create the Direct Lake model based on the import/DQ semantic model\n","\n","Calculated columns are not migrated to the Direct Lake model as they are not supported in Direct Lake mode."]},{"cell_type":"code","execution_count":null,"id":"0a3616b5-566e-414e-a225-fb850d6418dc","metadata":{"jupyter":{"outputs_hidden":false,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["import time\n","labs.create_blank_semantic_model(dataset = new_dataset_name, workspace = new_dataset_workspace_name)\n","\n","time.sleep(2)\n","\n","migration.migrate_calc_tables_to_lakehouse(\n"," dataset = dataset_name,\n"," new_dataset = new_dataset_name,\n"," workspace = workspace_name,\n"," new_dataset_workspace = new_dataset_workspace_name,\n"," lakehouse = lakehouse_name,\n"," lakehouse_workspace = lakehouse_workspace_name)\n","migration.migrate_tables_columns_to_semantic_model(\n"," dataset = dataset_name,\n"," new_dataset = new_dataset_name,\n"," workspace = workspace_name,\n"," new_dataset_workspace = new_dataset_workspace_name,\n"," lakehouse = lakehouse_name,\n"," lakehouse_workspace = lakehouse_workspace_name)\n","migration.migrate_calc_tables_to_semantic_model(\n"," dataset = dataset_name,\n"," new_dataset = new_dataset_name,\n"," workspace = workspace_name,\n"," new_dataset_workspace = new_dataset_workspace_name,\n"," lakehouse = lakehouse_name,\n"," lakehouse_workspace = lakehouse_workspace_name)\n","migration.migrate_model_objects_to_semantic_model(\n"," dataset = dataset_name,\n"," new_dataset = new_dataset_name,\n"," workspace = workspace_name,\n"," new_dataset_workspace = new_dataset_workspace_name)\n","migration.migrate_field_parameters(\n"," dataset = dataset_name,\n"," new_dataset = new_dataset_name,\n"," workspace = workspace_name,\n"," new_dataset_workspace = new_dataset_workspace_name)\n","time.sleep(2)\n","labs.refresh_semantic_model(dataset = new_dataset_name, workspace = new_dataset_workspace_name)\n","migration.refresh_calc_tables(dataset = new_dataset_name, workspace = new_dataset_workspace_name)\n","labs.refresh_semantic_model(dataset = new_dataset_name, workspace = new_dataset_workspace_name)"]},{"cell_type":"markdown","id":"bb98bb13","metadata":{},"source":["### Show migrated/unmigrated objects"]},{"cell_type":"code","execution_count":null,"id":"5db2f22c","metadata":{},"outputs":[],"source":["migration.migration_validation(\n"," dataset = dataset_name,\n"," new_dataset = new_dataset_name, \n"," workspace = workspace_name, \n"," new_dataset_workspace = new_dataset_workspace_name)"]},{"cell_type":"markdown","id":"fa244e9d-87c2-4a66-a7e0-be539a0ac7de","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Rebind all reports using the old semantic model to the new Direct Lake semantic model"]},{"cell_type":"code","execution_count":null,"id":"d4e867cc","metadata":{},"outputs":[],"source":["report.report_rebind_all(\n"," dataset = dataset_name,\n"," dataset_workspace = workspace_name,\n"," new_dataset = new_dataset_name,\n"," new_dataset_workpace = new_dataset_workspace_name,\n"," report_workspace = workspace_name)"]},{"cell_type":"markdown","id":"3365d20d","metadata":{},"source":["### Rebind reports one-by-one (optional)"]},{"cell_type":"code","execution_count":null,"id":"056b7180-d7ac-492c-87e7-ac7d0e4bb929","metadata":{"jupyter":{"outputs_hidden":false,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["report_name = '' # Enter report name which you want to rebind to the new Direct Lake model\n","\n","report.report_rebind(\n"," report = report_name,\n"," dataset = new_dataset_name,\n"," report_workspace=workspace_name,\n"," dataset_workspace = new_dataset_workspace_name)"]},{"cell_type":"markdown","id":"526f2327","metadata":{},"source":["### Show unsupported objects"]},{"cell_type":"code","execution_count":null,"id":"a47376d7","metadata":{},"outputs":[],"source":["dfT, dfC, dfR = directlake.show_unsupported_direct_lake_objects(dataset = dataset_name, workspace = workspace_name)\n","\n","print('Calculated Tables are not supported...')\n","display(dfT)\n","print(\"Learn more about Direct Lake limitations here: https://learn.microsoft.com/power-bi/enterprise/directlake-overview#known-issues-and-limitations\")\n","print('Calculated columns are not supported. Columns of binary data type are not supported.')\n","display(dfC)\n","print('Columns used for relationship cannot be of data type datetime and they also must be of the same data type.')\n","display(dfR)"]},{"cell_type":"markdown","id":"ed08ba4c","metadata":{},"source":["### Schema check between semantic model tables/columns and lakehouse tables/columns\n","\n","This will list any tables/columns which are in the new semantic model but do not exist in the lakehouse"]},{"cell_type":"code","execution_count":null,"id":"03889ba4","metadata":{},"outputs":[],"source":["directlake.direct_lake_schema_compare(dataset = new_dataset_name, workspace = new_dataset_workspace_name)"]},{"cell_type":"markdown","id":"2229963b","metadata":{},"source":["### Show calculated tables which have been migrated to the Direct Lake semantic model as regular tables"]},{"cell_type":"code","execution_count":null,"id":"dd537d90","metadata":{},"outputs":[],"source":["directlake.list_direct_lake_model_calc_tables(dataset = new_dataset_name, workspace = new_dataset_workspace_name)"]}],"metadata":{"kernel_info":{"name":"synapse_pyspark"},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.12.3"},"microsoft":{"language":"python"},"nteract":{"version":"nteract-front-end@1.0.0"},"spark_compute":{"compute_id":"/trident/default"},"synapse_widget":{"state":{},"version":"0.1"},"widgets":{}},"nbformat":4,"nbformat_minor":5}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"cells":[{"cell_type":"markdown","id":"5c27dfd1-4fe0-4a97-92e6-ddf78889aa93","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Install the latest .whl package\n","\n","Check [here](https://pypi.org/project/semantic-link-labs/) to see the latest version."]},{"cell_type":"code","execution_count":null,"id":"d5cae9db-cef9-48a8-a351-9c5fcc99645c","metadata":{"jupyter":{"outputs_hidden":true,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["%pip install semantic-link-labs"]},{"cell_type":"markdown","id":"cd8de5a0","metadata":{},"source":["### Import the library"]},{"cell_type":"code","execution_count":null,"id":"5cc6eedf","metadata":{},"outputs":[],"source":["import sempy_labs as labs\n","from sempy_labs import lakehouse as lake\n","from sempy_labs import directlake"]},{"cell_type":"markdown","id":"5a3fe6e8-b8aa-4447-812b-7931831e07fe","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Vertipaq Analyzer"]},{"cell_type":"code","execution_count":null,"id":"cde43b47-4ecc-46ae-9125-9674819c7eab","metadata":{"jupyter":{"outputs_hidden":false,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["labs.vertipaq_analyzer(dataset = '', workspace = None)"]},{"cell_type":"markdown","id":"419a348f","metadata":{},"source":["Export the Vertipaq Analyzer results to a .zip file in your lakehouse"]},{"cell_type":"code","execution_count":null,"id":"8aa239b3","metadata":{},"outputs":[],"source":["labs.vertipaq_analyzer(dataset = '', workspace = None, export = 'zip')"]},{"cell_type":"markdown","id":"2dce0f4f","metadata":{},"source":["Export the Vertipaq Analyzer results to append to delta tables in your lakehouse."]},{"cell_type":"code","execution_count":null,"id":"aef93fc8","metadata":{},"outputs":[],"source":["labs.vertipaq_analyzer(dataset = '', workspace = None, export = 'table')"]},{"cell_type":"markdown","id":"1c62a802","metadata":{},"source":["Visualize the contents of an exported Vertipaq Analzyer .zip file."]},{"cell_type":"code","execution_count":null,"id":"9e349954","metadata":{},"outputs":[],"source":["labs.import_vertipaq_analyzer(folder_path = '', file_name = '')"]},{"cell_type":"markdown","id":"456ce0ff","metadata":{},"source":["### Best Practice Analzyer\n","\n","This runs the [standard rules](https://github.com/microsoft/Analysis-Services/tree/master/BestPracticeRules) for semantic models posted on Microsoft's GitHub."]},{"cell_type":"code","execution_count":null,"id":"0a3616b5-566e-414e-a225-fb850d6418dc","metadata":{"jupyter":{"outputs_hidden":false,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["labs.run_model_bpa(dataset = '', workspace = None)"]},{"cell_type":"markdown","id":"6fb32a58","metadata":{},"source":["This runs the rules and exports the results to a table in your lakehouse."]},{"cell_type":"code","execution_count":null,"id":"677851c3","metadata":{},"outputs":[],"source":["labs.run_model_bpa(dataset = '', workspace = None, export = True)"]},{"cell_type":"markdown","id":"8126a1a1","metadata":{},"source":["### Direct Lake\n","\n","Check if any lakehouse tables will hit the [Direct Lake guardrails](https://learn.microsoft.com/power-bi/enterprise/directlake-overview#fallback)."]},{"cell_type":"code","execution_count":null,"id":"e7397b15","metadata":{},"outputs":[],"source":["lake.get_lakehouse_tables(lakehouse = None, workspace = None, extended = True, count_rows = False)"]},{"cell_type":"code","execution_count":null,"id":"b30074cf","metadata":{},"outputs":[],"source":["lake.get_lakehouse_tables(lakehouse = None, workspace = None, extended = True, count_rows = False, export = True)"]},{"cell_type":"markdown","id":"99b84f2b","metadata":{},"source":["Check if any tables in a Direct Lake semantic model will fall back to DirectQuery."]},{"cell_type":"code","execution_count":null,"id":"f837be58","metadata":{},"outputs":[],"source":["directlake.check_fallback_reason(dataset = '', workspace = None)"]},{"cell_type":"markdown","id":"8f6df93e","metadata":{},"source":["### [OPTIMIZE](https://docs.delta.io/latest/optimizations-oss.html) your lakehouse delta tables."]},{"cell_type":"code","execution_count":null,"id":"e0262c9e","metadata":{},"outputs":[],"source":["lake.optimize_lakehouse_tables(tables = ['', ''], lakehouse = None, workspace = None)"]},{"cell_type":"markdown","id":"0091d6a0","metadata":{},"source":["Refresh/reframe your Direct Lake semantic model and restore the columns which were in memory prior to the refresh."]},{"cell_type":"code","execution_count":null,"id":"77eef082","metadata":{},"outputs":[],"source":["directlake.warm_direct_lake_cache_isresident(dataset = '', workspace = None)"]},{"cell_type":"markdown","id":"dae1a210","metadata":{},"source":["Ensure a warm cache for your users by putting the columns of a Direct Lake semantic model into memory based on the contents of a [perspective](https://learn.microsoft.com/analysis-services/tabular-models/perspectives-ssas-tabular?view=asallproducts-allversions).\n","\n","Perspectives can be created either in [Tabular Editor 3](https://github.com/TabularEditor/TabularEditor3/releases/latest) or in [Tabular Editor 2](https://github.com/TabularEditor/TabularEditor/releases/latest) using the [Perspective Editor](https://www.elegantbi.com/post/perspectiveeditor)."]},{"cell_type":"code","execution_count":null,"id":"43297001","metadata":{},"outputs":[],"source":["directlake.warm_direct_lake_cache_perspective(dataset = '', workspace = None, perspective = '', add_dependencies = True)"]}],"metadata":{"kernel_info":{"name":"synapse_pyspark"},"kernelspec":{"display_name":"Synapse PySpark","language":"Python","name":"synapse_pyspark"},"language_info":{"name":"python"},"microsoft":{"language":"python"},"nteract":{"version":"nteract-front-end@1.0.0"},"spark_compute":{"compute_id":"/trident/default"},"synapse_widget":{"state":{},"version":"0.1"},"widgets":{}},"nbformat":4,"nbformat_minor":5}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"cells":[{"cell_type":"markdown","id":"5c27dfd1-4fe0-4a97-92e6-ddf78889aa93","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Install the latest .whl package\n","\n","Check [here](https://pypi.org/project/semantic-link-labs/) to see the latest version."]},{"cell_type":"code","execution_count":null,"id":"d5cae9db-cef9-48a8-a351-9c5fcc99645c","metadata":{"jupyter":{"outputs_hidden":true,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["%pip install semantic-link-labs"]},{"cell_type":"markdown","id":"b195eae8","metadata":{},"source":["### Import the library and set the initial parameters"]},{"cell_type":"code","execution_count":null,"id":"1344e286","metadata":{},"outputs":[],"source":["import sempy_labs as labs\n","dataset = '' # Enter your dataset name\n","workspace = None # Enter your workspace name (if set to None it will use the workspace in which the notebook is running)"]},{"cell_type":"markdown","id":"5a3fe6e8-b8aa-4447-812b-7931831e07fe","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### View [Query Scale Out](https://learn.microsoft.com/power-bi/enterprise/service-premium-scale-out) (QSO) settings"]},{"cell_type":"code","execution_count":null,"id":"9e349954","metadata":{},"outputs":[],"source":["labs.list_qso_settings(dataset = dataset, workspace = workspace )"]},{"cell_type":"markdown","id":"b0717cbb","metadata":{},"source":["### [Configure Query Scale Out](https://learn.microsoft.com/power-bi/enterprise/service-premium-scale-out-configure)\n","Setting 'auto_sync' to True will ensure that the semantic model automatically syncs read-only replicas. Setting this to False will necessitate syncing the replicas (i.e. via the qso_sync function).\n","\n","The 'max_read_only_replicas' is the maximum number of read-only replicas for the semantic model (0-64, -1 for automatic number of replicas).\n"]},{"cell_type":"code","execution_count":null,"id":"ec37dd14","metadata":{},"outputs":[],"source":["labs.set_qso(dataset = dataset, auto_sync = False, max_read_only_replicas = -1, workspace = workspace)"]},{"cell_type":"markdown","id":"5d6beadd","metadata":{},"source":["### Sync Query Scale Out replicas"]},{"cell_type":"code","execution_count":null,"id":"7ca10963","metadata":{},"outputs":[],"source":["labs.qso_sync(dataset = dataset, workspace = workspace)"]},{"cell_type":"markdown","id":"719f428f","metadata":{},"source":["### Check Query Scale Out Sync Status"]},{"cell_type":"code","execution_count":null,"id":"db6f197c","metadata":{},"outputs":[],"source":["dfA, dfB = labs.qso_sync_status(dataset = dataset, workspace = workspace)\n","display(dfA)\n","display(dfB)"]},{"cell_type":"markdown","id":"e92cdf34","metadata":{},"source":["### Disable Query Scale Out"]},{"cell_type":"code","execution_count":null,"id":"0624d649","metadata":{},"outputs":[],"source":["labs.disable_qso(dataset = dataset, workspace = workspace)"]},{"cell_type":"markdown","id":"786d89bc","metadata":{},"source":["### Enable large semantic model format"]},{"cell_type":"code","execution_count":null,"id":"d521b228","metadata":{},"outputs":[],"source":["labs.set_semantic_model_storage_format(dataset = dataset, storage_format = 'Large', workspace = workspace)"]},{"cell_type":"markdown","id":"e90c20e9","metadata":{},"source":["### Disable large semantic model format"]},{"cell_type":"code","execution_count":null,"id":"433220b2","metadata":{},"outputs":[],"source":["labs.set_semantic_model_storage_format(dataset = dataset, storage_format = 'Small', workspace = workspace)"]}],"metadata":{"kernel_info":{"name":"synapse_pyspark"},"kernelspec":{"display_name":"Synapse PySpark","language":"Python","name":"synapse_pyspark"},"language_info":{"name":"python"},"microsoft":{"language":"python"},"nteract":{"version":"nteract-front-end@1.0.0"},"spark_compute":{"compute_id":"/trident/default"},"synapse_widget":{"state":{},"version":"0.1"},"widgets":{}},"nbformat":4,"nbformat_minor":5}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"cells":[{"cell_type":"markdown","id":"5c27dfd1-4fe0-4a97-92e6-ddf78889aa93","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Install the latest .whl package\n","\n","Check [here](https://pypi.org/project/semantic-link-labs/) to see the latest version."]},{"cell_type":"code","execution_count":null,"id":"d5cae9db-cef9-48a8-a351-9c5fcc99645c","metadata":{"jupyter":{"outputs_hidden":true,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["%pip install semantic-link-labs"]},{"cell_type":"markdown","id":"5a3fe6e8-b8aa-4447-812b-7931831e07fe","metadata":{"nteract":{"transient":{"deleting":false}}},"source":["### Connect to the [Tabular Object Model](https://learn.microsoft.com/analysis-services/tom/introduction-to-the-tabular-object-model-tom-in-analysis-services-amo?view=asallproducts-allversions) ([TOM](https://learn.microsoft.com/dotnet/api/microsoft.analysisservices.tabular.model?view=analysisservices-dotnet))\n","Setting the 'readonly' property to False enables read/write mode. This allows changes to be made to the semantic model."]},{"cell_type":"code","execution_count":null,"id":"cde43b47-4ecc-46ae-9125-9674819c7eab","metadata":{"jupyter":{"outputs_hidden":false,"source_hidden":false},"nteract":{"transient":{"deleting":false}}},"outputs":[],"source":["import sempy_labs as labs\n","from sempy_labs.tom import connect_semantic_model\n","\n","dataset = '' # Enter dataset name\n","workspace = None # Enter workspace name\n","\n","with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," print(t.Name)"]},{"cell_type":"markdown","id":"fc6b277e","metadata":{},"source":["### Make changes to a semantic model using custom functions\n","Note that the custom functions have additional optional parameters (which may not be used in the examples below) for adding properties to model objects. Check the [documentation](https://semantic-link-labs.readthedocs.io/en/0.5.0/sempy_labs.tom.html) to see all available parameters for each function."]},{"cell_type":"markdown","id":"402a477c","metadata":{},"source":["#### Add measure(s) to the semantic model"]},{"cell_type":"code","execution_count":null,"id":"bdaaaa5c","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_measure(table_name ='Internet Sales', measure_name = 'Sales Amount', expression = \"SUM('Internet Sales'[SalesAmount])\")\n"," tom.add_measure(table_name ='Internet Sales', measure_name = 'Order Quantity', expression = \"SUM('Internet Sales'[OrderQty])\") "]},{"cell_type":"code","execution_count":null,"id":"a53a544b","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," if t.Name == 'Internet Sales':\n"," tom.add_measure(table_name = t.Name, measure_name = 'Sales Amount', expression = \"SUM('Internet Sales'[SalesAmount])\")\n"," tom.add_measure(table_name = t.Name, measure_name = 'Order Quantity', expression = \"SUM('Internet Sales'[OrderQty])\")"]},{"cell_type":"markdown","id":"1cb1632f","metadata":{},"source":["#### Add column(s) to the semantic model"]},{"cell_type":"code","execution_count":null,"id":"81a22749","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_data_column(table_name ='Product', column_name = 'Size Range', source_column = 'SizeRange', data_type = 'Int64')\n"," tom.add_data_column(table_name = 'Segment', column_name = 'Summary Segment', source_column = 'SummarySegment', data_type = 'String')\n","\n"," tom.add_calculated_column(table_name = 'Internet Sales', column_name = 'GrossMargin', expression = \"'Internet Sales'[SalesAmount] - 'Internet Sales'[ProductCost]\", data_type = 'Decimal')"]},{"cell_type":"code","execution_count":null,"id":"053b6516","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," if t.Name == 'Product':\n"," tom.add_data_column(table_name = t.Name, column_name = 'Size Range', source_column = 'SizeRange', data_type = 'Int64')\n"," elif t.Name == 'Segment':\n"," tom.add_data_column(table_name = t.Name, column_name = 'Summary Segment', source_column = 'SummarySegment', data_type = 'String')\n"," elif t.Name == 'Internet Sales':\n"," tom.add_calculated_column(table_name = t.Name, column_name = 'GrossMargin', expression = \"'Internet Sales'[SalesAmount] - 'Internet Sales'[ProductCost]\", data_type = 'Decimal')"]},{"cell_type":"markdown","id":"f53dcca7","metadata":{},"source":["#### Add hierarchies to the semantic model"]},{"cell_type":"code","execution_count":null,"id":"a9309e23","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_hierarchy(table_name = 'Geography', hierarchy_name = 'Geo Hierarchy', levels = ['Continent', 'Country', 'State', 'City'])"]},{"cell_type":"code","execution_count":null,"id":"a04281ce","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," if t.Name == 'Geography':\n"," tom.add_hierarchy(table_name = t.Name, hierarchy_name = 'Geo Hierarchy', levels = ['Continent', 'Country', 'State', 'City'])"]},{"cell_type":"markdown","id":"47c06a4f","metadata":{},"source":["#### Add relationship(s) to the semantic model"]},{"cell_type":"code","execution_count":null,"id":"e8cd7bbf","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_relationship(\n"," from_table = 'Internet Sales', from_column = 'ProductKey',\n"," to_table = 'Product', to_column = 'ProductKey', \n"," from_cardinality = 'Many', to_cardinality = 'One')"]},{"cell_type":"markdown","id":"3cc7f11e","metadata":{},"source":["#### Add a table with an M partition to a semantic model"]},{"cell_type":"code","execution_count":null,"id":"0f5dd66a","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," table_name = 'Sales'\n"," tom.add_table(name = table_name)\n"," tom.add_m_partition(table_name = table_name, partition_name = table_name, expression = 'let....')"]},{"cell_type":"markdown","id":"ea389123","metadata":{},"source":["#### Add a table with an entity partition to a Direct Lake semantic model "]},{"cell_type":"code","execution_count":null,"id":"f75387d1","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," table_name = 'Sales'\n"," tom.add_table(name = table_name)\n"," tom.add_entity_partition(table_name = table_name, entity_name = table_name)"]},{"cell_type":"markdown","id":"e74d0f54","metadata":{},"source":["#### Add a calculated table (and columns) to a semantic model"]},{"cell_type":"code","execution_count":null,"id":"934f7315","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," table_name = 'Sales'\n"," tom.add_calculated_table(name = table_name, expression = \"DISTINCT('Product'[Color])\")\n"," tom.add_calculated_table_column(table_name = table_name, column_name = 'Color', source_column = \"'Product[Color]\", data_type = 'String')"]},{"cell_type":"markdown","id":"0e7088b7","metadata":{},"source":["#### Add role(s) to the semantic model"]},{"cell_type":"code","execution_count":null,"id":"ad60ebb9","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_role(role_name = 'Reader')"]},{"cell_type":"markdown","id":"c541f81a","metadata":{},"source":["#### Set row level security (RLS) to the semantic model\n","This adds row level security (or updates it if it already exists)"]},{"cell_type":"code","execution_count":null,"id":"98603a08","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.set_rls(role_name ='Reader', table_name = 'Product', filter_expression = \"'Dim Product'[Color] = \\\"Blue\\\"\")"]},{"cell_type":"code","execution_count":null,"id":"effea009","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for r in tom.model.Roles:\n"," if r.Name == 'Reader':\n"," tom.set_rls(role_name = r.Name, table_name = 'Product', filter_expression = \"'Dim Product'[Color] = \\\"Blue\\\"\")"]},{"cell_type":"markdown","id":"7fa7a03c","metadata":{},"source":["#### Set object level security (OLS) to the semantic model\n","This adds row level security (or updates it if it already exists)"]},{"cell_type":"code","execution_count":null,"id":"dd0def9d","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.set_ols(role_name = 'Reader', table_name = 'Product', column_name = 'Size', permission = 'None')"]},{"cell_type":"code","execution_count":null,"id":"7a389dc7","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for r in tom.model.Roles:\n"," if r.Name == 'Reader':\n"," for t in tom.model.Tables:\n"," if t.Name == 'Product':\n"," tom.set_ols(role_name = r.Name, table_name = t.Name, column_name = 'Size', permission = 'None')"]},{"cell_type":"markdown","id":"d0f7ccd1","metadata":{},"source":["#### Add calculation groups and calculation items to the semantic model"]},{"cell_type":"code","execution_count":null,"id":"97f4708b","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_calculation_group(name = 'MyCalcGroup')"]},{"cell_type":"code","execution_count":null,"id":"fef68832","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_calculation_item(table_name = 'MyCalcGroup', calculation_item_name = 'YTD', expression = \"CALCULATE(SELECTEDMEASURE(), DATESYTD('Calendar'[CalendarDate]))\")\n"," tom.add_calculation_item(table_name = 'MyCalcGroup', calculation_item_name = 'MTD', expression = \"CALCULATE(SELECTEDMEASURE(), DATESMTD('Calendar'[CalendarDate]))\")"]},{"cell_type":"code","execution_count":null,"id":"c7653dcc","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," if t.Name == 'MyCalcGroup':\n"," tom.add_calculation_item(table_name = t.Name, calculation_item_name = 'YTD', expression = \"CALCULATE(SELECTEDMEASURE(), DATESYTD('Calendar'[CalendarDate]))\")\n"," tom.add_calculation_item(table_name = t.Name, calculation_item_name = 'MTD', expression = \"CALCULATE(SELECTEDMEASURE(), DATESMTD('Calendar'[CalendarDate]))\")"]},{"cell_type":"markdown","id":"c6450c74","metadata":{},"source":["#### Add translations to a semantic model"]},{"cell_type":"code","execution_count":null,"id":"2b616b90","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_translation(language = 'it-IT')"]},{"cell_type":"code","execution_count":null,"id":"dc24c200","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.set_translation(object = tom.model.Tables['Product'], language = 'it-IT', property = 'Name', value = 'Produtto')"]},{"cell_type":"markdown","id":"3048cc95","metadata":{},"source":["#### Add a [Field Parameter](https://learn.microsoft.com/power-bi/create-reports/power-bi-field-parameters) to a semantic model"]},{"cell_type":"code","execution_count":null,"id":"0a94af94","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.add_field_parameter(table_name = 'Parameter', objects = \"'Product'[Color], [Sales Amount], 'Geography'[Country]\")"]},{"cell_type":"markdown","id":"95aac09a","metadata":{},"source":["#### Remove an object(s) from a semantic model"]},{"cell_type":"code","execution_count":null,"id":"1e2572a8","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," if t.Name == 'Product':\n"," tom.remove_object(object = t.Columns['Size'])\n"," tom.remove_object(object = t.Hierarchies['Product Hierarchy'])"]},{"cell_type":"code","execution_count":null,"id":"bc453177","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.remove_object(object = tom.model.Tables['Product'].Columns['Size'])\n"," tom.remove_object(object = tom.model.Tables['Product'].Hierarchies['Product Hierarchy'])"]},{"cell_type":"markdown","id":"e0d0cb9e","metadata":{},"source":["### Custom functions to loop through non-top-level objects in a semantic model"]},{"cell_type":"code","execution_count":null,"id":"cbe3b1a3","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for c in tom.all_columns():\n"," print(c.Name)"]},{"cell_type":"code","execution_count":null,"id":"3f643e66","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for m in tom.all_measures():\n"," print(m.Name)"]},{"cell_type":"code","execution_count":null,"id":"ed1cde0f","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for p in tom.all_partitions():\n"," print(p.Name)"]},{"cell_type":"code","execution_count":null,"id":"f48014ae","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for h in tom.all_hierarchies():\n"," print(h.Name)"]},{"cell_type":"code","execution_count":null,"id":"9f5e7b72","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for ci in tom.all_calculation_items():\n"," print(ci.Name)"]},{"cell_type":"code","execution_count":null,"id":"3cd9ebc1","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for l in tom.all_levels():\n"," print(l.Name)"]},{"cell_type":"code","execution_count":null,"id":"12c58bad","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," for rls in tom.all_rls():\n"," print(rls.Name)"]},{"cell_type":"markdown","id":"1a294bd2","metadata":{},"source":["### See Vertipaq Analyzer stats"]},{"cell_type":"code","execution_count":null,"id":"469660e9","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=False, workspace=workspace) as tom:\n"," tom.set_vertipaq_annotations()\n","\n"," for t in tom.model.Tables:\n"," rc = tom.row_count(object = t)\n"," print(t.Name + ' : ' + str(rc))\n"," for c in t.Columns:\n"," col_size = tom.total_size(column = c)\n"," print(labs.format_dax_object_name(t.Name, c.Name) + ' : ' + str(col_size))"]},{"cell_type":"markdown","id":"1ab26dfd","metadata":{},"source":["### 'UsedIn' functions"]},{"cell_type":"code","execution_count":null,"id":"412bf287","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for c in tom.all_columns():\n"," full_name = labs.format_dax_object_name(c.Parent.Name, c.Name)\n"," for h in tom.used_in_hierarchies(column = c):\n"," print(full_name + ' : ' + h.Name)"]},{"cell_type":"code","execution_count":null,"id":"76556900","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for c in tom.all_columns():\n"," full_name = labs.format_dax_object_name(c.Parent.Name, c.Name)\n"," for r in tom.used_in_relationships(object = c):\n"," rel_name = labs.create_relationship_name(r.FromTable.Name, r.FromColumn.Name, r.ToTable.Name, r.ToColumn.Name)\n"," print(full_name + ' : ' + rel_name)"]},{"cell_type":"code","execution_count":null,"id":"4d9ec24e","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," for t in tom.model.Tables:\n"," for r in tom.used_in_relationships(object = t):\n"," rel_name = labs.create_relationship_name(r.FromTable.Name, r.FromColumn.Name, r.ToTable.Name, r.ToColumn.Name)\n"," print(t.Name + ' : ' + rel_name)"]},{"cell_type":"code","execution_count":null,"id":"82251336","metadata":{},"outputs":[],"source":["with connect_semantic_model(dataset=dataset, readonly=True, workspace=workspace) as tom:\n"," dep = labs.get_model_calc_dependencies(dataset = dataset, workspace=workspace)\n"," for o in tom.used_in_rls(object = tom.model.Tables['Product'].Columns['Color'], dependencies=dep):\n"," print(o.Name)"]}],"metadata":{"kernel_info":{"name":"synapse_pyspark"},"kernelspec":{"display_name":"Synapse PySpark","language":"Python","name":"synapse_pyspark"},"language_info":{"name":"python"},"microsoft":{"language":"python"},"nteract":{"version":"nteract-front-end@1.0.0"},"spark_compute":{"compute_id":"/trident/default"},"synapse_widget":{"state":{},"version":"0.1"},"widgets":{}},"nbformat":4,"nbformat_minor":5}
|
|
@@ -7,7 +7,7 @@ name="semantic-link-labs"
|
|
|
7
7
|
authors = [
|
|
8
8
|
{ name = "Microsoft Corporation" },
|
|
9
9
|
]
|
|
10
|
-
version="0.
|
|
10
|
+
version="0.5.0"
|
|
11
11
|
description="Semantic Link Labs project"
|
|
12
12
|
requires-python=">=3.10,<3.12"
|
|
13
13
|
classifiers = [
|
|
@@ -37,4 +37,7 @@ Repository = "https://github.com/microsoft/semantic-link-labs.git"
|
|
|
37
37
|
|
|
38
38
|
[[tool.mypy.overrides]]
|
|
39
39
|
module = "sempy.*,Microsoft.*,System.*,anytree.*,powerbiclient.*,synapse.ml.services.*"
|
|
40
|
-
ignore_missing_imports = true
|
|
40
|
+
ignore_missing_imports = true
|
|
41
|
+
|
|
42
|
+
[tool.flake8]
|
|
43
|
+
max-line-length = 200
|
{semantic_link_labs-0.4.1 → semantic_link_labs-0.5.0}/src/semantic_link_labs.egg-info/SOURCES.txt
RENAMED
|
@@ -7,7 +7,11 @@ SECURITY.md
|
|
|
7
7
|
SUPPORT.md
|
|
8
8
|
environment.yml
|
|
9
9
|
pyproject.toml
|
|
10
|
+
.github/ISSUE_TEMPLATE/bug_report.md
|
|
11
|
+
.github/ISSUE_TEMPLATE/feature_request.md
|
|
12
|
+
.github/ISSUE_TEMPLATE/issue--question---advice-needed.md
|
|
10
13
|
.github/workflows/build.yaml
|
|
14
|
+
.github/workflows/codeql.yaml
|
|
11
15
|
.vscode/settings.json
|
|
12
16
|
docs/Makefile
|
|
13
17
|
docs/make.bat
|
|
@@ -39,7 +43,6 @@ src/sempy_labs/_model_dependencies.py
|
|
|
39
43
|
src/sempy_labs/_one_lake_integration.py
|
|
40
44
|
src/sempy_labs/_query_scale_out.py
|
|
41
45
|
src/sempy_labs/_refresh_semantic_model.py
|
|
42
|
-
src/sempy_labs/_tom.py
|
|
43
46
|
src/sempy_labs/_translations.py
|
|
44
47
|
src/sempy_labs/_vertipaq.py
|
|
45
48
|
src/sempy_labs/directlake/__init__.py
|
|
@@ -71,6 +74,8 @@ src/sempy_labs/report/__init__.py
|
|
|
71
74
|
src/sempy_labs/report/_generate_report.py
|
|
72
75
|
src/sempy_labs/report/_report_functions.py
|
|
73
76
|
src/sempy_labs/report/_report_rebind.py
|
|
77
|
+
src/sempy_labs/tom/__init__.py
|
|
78
|
+
src/sempy_labs/tom/_model.py
|
|
74
79
|
tests/__init__.py
|
|
75
80
|
tests/test_shortcuts.py
|
|
76
81
|
tests/test_tom.py
|
|
@@ -5,7 +5,7 @@ from sempy_labs._clear_cache import clear_cache
|
|
|
5
5
|
# create_connection_vnet,
|
|
6
6
|
# create_connection_on_prem
|
|
7
7
|
# )
|
|
8
|
-
from sempy_labs._dax import
|
|
8
|
+
from sempy_labs._dax import evaluate_dax_impersonation
|
|
9
9
|
from sempy_labs._generate_semantic_model import (
|
|
10
10
|
create_blank_semantic_model,
|
|
11
11
|
create_semantic_model_from_bim,
|
|
@@ -13,6 +13,8 @@ from sempy_labs._generate_semantic_model import (
|
|
|
13
13
|
get_semantic_model_bim,
|
|
14
14
|
)
|
|
15
15
|
from sempy_labs._list_functions import (
|
|
16
|
+
list_semantic_model_objects,
|
|
17
|
+
list_shortcuts,
|
|
16
18
|
get_object_level_security,
|
|
17
19
|
# list_annotations,
|
|
18
20
|
# list_columns,
|
|
@@ -32,9 +34,21 @@ from sempy_labs._list_functions import (
|
|
|
32
34
|
# list_sqlendpoints,
|
|
33
35
|
# list_tables,
|
|
34
36
|
list_warehouses,
|
|
35
|
-
|
|
37
|
+
list_workspace_role_assignments,
|
|
36
38
|
create_warehouse,
|
|
37
39
|
update_item,
|
|
40
|
+
list_custom_pools,
|
|
41
|
+
create_custom_pool,
|
|
42
|
+
update_custom_pool,
|
|
43
|
+
assign_workspace_to_capacity,
|
|
44
|
+
unassign_workspace_from_capacity,
|
|
45
|
+
get_spark_settings,
|
|
46
|
+
update_spark_settings,
|
|
47
|
+
add_user_to_workspace,
|
|
48
|
+
delete_user_from_workspace,
|
|
49
|
+
update_workspace_user,
|
|
50
|
+
list_workspace_users,
|
|
51
|
+
assign_workspace_to_dataflow_storage,
|
|
38
52
|
)
|
|
39
53
|
|
|
40
54
|
from sempy_labs._helper_functions import (
|
|
@@ -50,9 +64,9 @@ from sempy_labs._helper_functions import (
|
|
|
50
64
|
resolve_dataset_name,
|
|
51
65
|
resolve_report_id,
|
|
52
66
|
resolve_report_name,
|
|
53
|
-
#
|
|
67
|
+
# language_validate
|
|
54
68
|
)
|
|
55
|
-
from sempy_labs._model_auto_build import model_auto_build
|
|
69
|
+
# from sempy_labs._model_auto_build import model_auto_build
|
|
56
70
|
from sempy_labs._model_bpa import model_bpa_rules, run_model_bpa
|
|
57
71
|
from sempy_labs._model_dependencies import (
|
|
58
72
|
measure_dependency_tree,
|
|
@@ -62,16 +76,15 @@ from sempy_labs._model_dependencies import (
|
|
|
62
76
|
from sempy_labs._one_lake_integration import (
|
|
63
77
|
export_model_to_onelake,
|
|
64
78
|
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
# )
|
|
79
|
+
from sempy_labs._query_scale_out import (
|
|
80
|
+
qso_sync,
|
|
81
|
+
qso_sync_status,
|
|
82
|
+
set_qso,
|
|
83
|
+
list_qso_settings,
|
|
84
|
+
disable_qso,
|
|
85
|
+
set_semantic_model_storage_format,
|
|
86
|
+
set_workspace_default_storage_format,
|
|
87
|
+
)
|
|
75
88
|
from sempy_labs._refresh_semantic_model import (
|
|
76
89
|
refresh_semantic_model,
|
|
77
90
|
cancel_dataset_refresh,
|
|
@@ -82,14 +95,13 @@ from sempy_labs._vertipaq import (
|
|
|
82
95
|
# visualize_vertipaq,
|
|
83
96
|
import_vertipaq_analyzer,
|
|
84
97
|
)
|
|
85
|
-
from sempy_labs._tom import TOMWrapper, connect_semantic_model
|
|
86
98
|
|
|
87
99
|
__all__ = [
|
|
88
100
|
"clear_cache",
|
|
89
101
|
# create_connection_cloud,
|
|
90
102
|
# create_connection_vnet,
|
|
91
103
|
# create_connection_on_prem,
|
|
92
|
-
"
|
|
104
|
+
"evaluate_dax_impersonation",
|
|
93
105
|
"create_blank_semantic_model",
|
|
94
106
|
"create_semantic_model_from_bim",
|
|
95
107
|
#'deploy_semantic_model',
|
|
@@ -113,7 +125,7 @@ __all__ = [
|
|
|
113
125
|
#'list_sqlendpoints',
|
|
114
126
|
#'list_tables',
|
|
115
127
|
"list_warehouses",
|
|
116
|
-
|
|
128
|
+
'list_workspace_role_assignments',
|
|
117
129
|
"create_warehouse",
|
|
118
130
|
"update_item",
|
|
119
131
|
"create_abfss_path",
|
|
@@ -129,26 +141,38 @@ __all__ = [
|
|
|
129
141
|
"resolve_report_id",
|
|
130
142
|
"resolve_report_name",
|
|
131
143
|
#'language_validate',
|
|
132
|
-
"model_auto_build",
|
|
144
|
+
#"model_auto_build",
|
|
133
145
|
"model_bpa_rules",
|
|
134
146
|
"run_model_bpa",
|
|
135
147
|
"measure_dependency_tree",
|
|
136
148
|
"get_measure_dependencies",
|
|
137
149
|
"get_model_calc_dependencies",
|
|
138
150
|
"export_model_to_onelake",
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
'qso_sync',
|
|
152
|
+
'qso_sync_status',
|
|
153
|
+
'set_qso',
|
|
154
|
+
'list_qso_settings',
|
|
155
|
+
'disable_qso',
|
|
156
|
+
'set_semantic_model_storage_format',
|
|
157
|
+
'set_workspace_default_storage_format',
|
|
146
158
|
"refresh_semantic_model",
|
|
147
159
|
"cancel_dataset_refresh",
|
|
148
160
|
"translate_semantic_model",
|
|
149
161
|
"vertipaq_analyzer",
|
|
150
162
|
#'visualize_vertipaq',
|
|
151
163
|
"import_vertipaq_analyzer",
|
|
152
|
-
"
|
|
153
|
-
"
|
|
164
|
+
"list_semantic_model_objects",
|
|
165
|
+
"list_shortcuts",
|
|
166
|
+
"list_custom_pools",
|
|
167
|
+
"create_custom_pool",
|
|
168
|
+
"update_custom_pool",
|
|
169
|
+
"assign_workspace_to_capacity",
|
|
170
|
+
"unassign_workspace_from_capacity",
|
|
171
|
+
"get_spark_settings",
|
|
172
|
+
"update_spark_settings",
|
|
173
|
+
"add_user_to_workspace",
|
|
174
|
+
"delete_user_from_workspace",
|
|
175
|
+
"update_workspace_user",
|
|
176
|
+
"list_workspace_users",
|
|
177
|
+
"assign_workspace_to_dataflow_storage"
|
|
154
178
|
]
|