From 97bb36315c4a67055ed5f92404b27c483714304e Mon Sep 17 00:00:00 2001 From: m-kovalsky Date: Tue, 18 Jun 2024 11:20:41 +0300 Subject: [PATCH] updated str to dict (#15) * updated str to dict * fixed issue --- src/sempy_labs/_generate_semantic_model.py | 4 ++-- src/sempy_labs/_query_scale_out.py | 1 + src/sempy_labs/directlake/_directlake_schema_compare.py | 1 + .../_update_directlake_model_lakehouse_connection.py | 1 + src/sempy_labs/directlake/_warm_cache.py | 1 + src/sempy_labs/lakehouse/_shortcuts.py | 1 + src/sempy_labs/report/_generate_report.py | 9 +++++---- src/sempy_labs/report/_report_functions.py | 1 + src/sempy_labs/report/_report_rebind.py | 1 + 9 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/sempy_labs/_generate_semantic_model.py b/src/sempy_labs/_generate_semantic_model.py index b02d7292..54d2c566 100644 --- a/src/sempy_labs/_generate_semantic_model.py +++ b/src/sempy_labs/_generate_semantic_model.py @@ -65,7 +65,7 @@ def create_blank_semantic_model( def create_semantic_model_from_bim( - dataset: str, bim_file: str, workspace: Optional[str] = None + dataset: str, bim_file: dict, workspace: Optional[str] = None ): """ Creates a new semantic model based on a Model.bim file. @@ -74,7 +74,7 @@ def create_semantic_model_from_bim( ---------- dataset : str Name of the semantic model. - bim_file : str + bim_file : dict The model.bim file. workspace : str, default=None The Fabric workspace name. diff --git a/src/sempy_labs/_query_scale_out.py b/src/sempy_labs/_query_scale_out.py index 49082db0..7579e32b 100644 --- a/src/sempy_labs/_query_scale_out.py +++ b/src/sempy_labs/_query_scale_out.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric import pandas as pd from sempy_labs._helper_functions import resolve_dataset_id diff --git a/src/sempy_labs/directlake/_directlake_schema_compare.py b/src/sempy_labs/directlake/_directlake_schema_compare.py index 9be3a9d8..dcf12bcd 100644 --- a/src/sempy_labs/directlake/_directlake_schema_compare.py +++ b/src/sempy_labs/directlake/_directlake_schema_compare.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric import pandas as pd from sempy_labs._helper_functions import ( diff --git a/src/sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py b/src/sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py index e422585a..f51e3ce7 100644 --- a/src/sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py +++ b/src/sempy_labs/directlake/_update_directlake_model_lakehouse_connection.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric from sempy_labs.directlake._get_shared_expression import get_shared_expression from sempy_labs._helper_functions import ( diff --git a/src/sempy_labs/directlake/_warm_cache.py b/src/sempy_labs/directlake/_warm_cache.py index 74dfa33b..15c9f4d9 100644 --- a/src/sempy_labs/directlake/_warm_cache.py +++ b/src/sempy_labs/directlake/_warm_cache.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric import pandas as pd from tqdm.auto import tqdm diff --git a/src/sempy_labs/lakehouse/_shortcuts.py b/src/sempy_labs/lakehouse/_shortcuts.py index cbd72d99..384809bd 100644 --- a/src/sempy_labs/lakehouse/_shortcuts.py +++ b/src/sempy_labs/lakehouse/_shortcuts.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric from sempy_labs._helper_functions import ( resolve_lakehouse_name, diff --git a/src/sempy_labs/report/_generate_report.py b/src/sempy_labs/report/_generate_report.py index 0e509a12..d29776f1 100644 --- a/src/sempy_labs/report/_generate_report.py +++ b/src/sempy_labs/report/_generate_report.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric import pandas as pd import json, base64, time @@ -9,8 +10,8 @@ def create_report_from_reportjson( report: str, dataset: str, - report_json: str, - theme_json: Optional[str] = None, + report_json: dict, + theme_json: Optional[dict] = None, workspace: Optional[str] = None, ): """ @@ -22,9 +23,9 @@ def create_report_from_reportjson( Name of the report. dataset : str Name of the semantic model to connect to the report. - report_json : str + report_json : dict The report.json file to be used to create the report. - theme_json : str, default=None + theme_json : dict, default=None The theme.json file to be used for the theme of the report. workspace : str, default=None The Fabric workspace name. diff --git a/src/sempy_labs/report/_report_functions.py b/src/sempy_labs/report/_report_functions.py index 1e6f516c..d87dee67 100644 --- a/src/sempy_labs/report/_report_functions.py +++ b/src/sempy_labs/report/_report_functions.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric import pandas as pd import json, os, time, base64, copy diff --git a/src/sempy_labs/report/_report_rebind.py b/src/sempy_labs/report/_report_rebind.py index 97f43d1e..d5ed5559 100644 --- a/src/sempy_labs/report/_report_rebind.py +++ b/src/sempy_labs/report/_report_rebind.py @@ -1,3 +1,4 @@ +import sempy import sempy.fabric as fabric from sempy_labs._helper_functions import resolve_dataset_id, resolve_report_id from typing import Optional