top of page

A Quick Blog Post – Converting Direct Lake to Import Mode (and Rebinding Reports)

This is one of those scripts I keep going back to… so it’s time to give it a proper home. If you’re like me and often work with open datasets, you’ll know the end result needs to be published to web. And for that? You need Import mode — for obvious reasons.


That’s when I find myself reaching for this quick fix. Thanks to the brilliant semantic-link-labs package, converting from Direct Lake to Import mode is actually painless.


!pip install semantic-link-labs --quiet

import sempy_labs as labs
from sempy_labs.tom import connect_semantic_model
from sempy_labs import migration
import sempy_labs.report as rep

# Step 1: Convert your model to Import mode
dataset = 'SM_Mausam_Metricss'
workspace = 'b13519ad-75cb-40af-a287-ac043f3d3f2a'
migration.migrate_direct_lake_to_import(dataset=dataset, workspace=workspace)

# Step 2: Rebind your report to the new Import mode model
report = 'Travel Weather Explorer'
dataset = 'dda103b9-08dc-4aa5-9fcd-de1186f3a587'  # New Import mode dataset
report_workspace = 'b13519ad-75cb-40af-a287-ac043f3d3f2a'
dataset_workspace = 'b13519ad-75cb-40af-a287-ac043f3d3f2a'

rep.report_rebind(
    report=report,
    dataset=dataset,
    report_workspace=report_workspace,
    dataset_workspace=dataset_workspace
)


Keep Smiling,

Prathy

 
 
 

Commentaires


bottom of page