mikova's avatar
mikova
Microsoft Employee
1 year ago

Refresh a Semantic Model

Download this notebook from: semantic-link-labs/notebooks/Semantic Model Refresh.ipynb at main · microsoft/semantic-link-labs · GitHub

 

Install the latest .whl package

Check here to see the latest version.

%pip install semantic-link-labs

Import the library and set the initial parameters

import sempy.fabric as fabric
import sempy_labs as labs
dataset = '' # Enter your dataset name
workspace = None # Enter your workspace name (if set to None it will use the workspace in which the notebook is running)

Refresh a semantic model

labs.refresh_semantic_model(dataset=dataset, workspace=workspace)

Visualize the refresh of a semantic model

The resulting dataframe returns the trace logs capturing the details of the refresh operation

df = labs.refresh_semantic_model(dataset=dataset, workspace=workspace, visualize=True)

Refresh specific tables

labs.refresh_semantic_model(dataset=dataset, workspace=workspace, tables=['Sales', 'Geography'])

Refresh specific partitions

labs.refresh_semantic_model(dataset=dataset, workspace=workspace, partitions=["'Sales'[Sales FY20]", "'Sales'[Sales FY21]"])

Refresh a combination of tables and partitions

labs.refresh_semantic_model(dataset=dataset, workspace=workspace, tables=['Geography', 'Calendar'], partitions=["'Sales'[Sales FY20]", "'Sales'[Sales FY21]"])

Clear the values of a table

labs.refresh_semantic_model(dataset=dataset, workspace=workspace, refresh_type='clearValues')

View semantic model refreshes

fabric.list_refresh_requests(dataset=dataset, workspace=workspace)

Cancel a semantic model refresh

labs.cancel_dataset_refresh(dataset=dataset, workspace=workspace)
# Specify the request_id based on a value from list_refresh_requests
labs.cancel_dataset_refresh(dataset=dataset, workspace=workspace, request_id='')

View a semantic model's refresh history

labs.get_semantic_model_refresh_history(dataset=dataset, workspace=workspace)

View details of a specific semantic model refresh

labs.get_semantic_model_refresh_history(dataset=dataset, workspace=workspace, request_id='')

 

 

No RepliesBe the first to reply