Skip to content

Commit 6c0373b

Browse files
committed
Updated db_to_pbi.py
1 parent 5d1163b commit 6c0373b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sample/UserApps/PowerBIPusher/db_to_pbi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def derive_bim(sp_url:str, sp_args:dict=None, dataset_name:str=None, timeout:flo
9696
return bim
9797

9898

99-
def deploy_dataset(model_bim:Mapping, dataset_name:str, workspace:str=None):
99+
def deploy_dataset(model_bim:Mapping, dataset_name:str=None, workspace:str=None):
100100
"""Create a pushable dataset (or update the metadata and schema for existing tables) in Power BI Service by a `Tabular Model <https://github.com/otykier/TabularEditor/wiki/Power-BI-Desktop-Integration>`__ ``.bim`` file.
101101
"""
102102
if isinstance(model_bim, str):
@@ -109,7 +109,9 @@ def deploy_dataset(model_bim:Mapping, dataset_name:str, workspace:str=None):
109109
raise ValueError(f"model_bim argument is not a valid JSON")
110110

111111
if not dataset_name:
112-
raise ValueError(f"dataset_name argument is missing")
112+
dataset_name = model_bim.get("name")
113+
if not dataset_name:
114+
raise ValueError(f"dataset_name argument is missing")
113115

114116
access_token = get_accesstoken()
115117

0 commit comments

Comments
 (0)