From b654f42a72df97d03dcbcac1d52a24084432b5c8 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 11 Oct 2024 12:18:37 +0200 Subject: [PATCH 1/3] added case insensitivity option --- src/sempy_labs/_warehouses.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sempy_labs/_warehouses.py b/src/sempy_labs/_warehouses.py index a309136d..c994c1aa 100644 --- a/src/sempy_labs/_warehouses.py +++ b/src/sempy_labs/_warehouses.py @@ -11,7 +11,7 @@ def create_warehouse( - warehouse: str, description: Optional[str] = None, workspace: Optional[str] = None + warehouse: str, description: Optional[str] = None, case_insensitive_collation: bool = False, workspace: Optional[str] = None ): """ Creates a Fabric warehouse. @@ -22,6 +22,8 @@ def create_warehouse( Name of the warehouse. description : str, default=None A description of the warehouse. + case_insensitive_collation: bool, default=False + If True, creates the warehouse with case-insensitive collation. workspace : str, default=None The Fabric workspace name. Defaults to None which resolves to the workspace of the attached lakehouse @@ -34,6 +36,9 @@ def create_warehouse( if description: request_body["description"] = description + if case_insensitive_collation: + request_body.setdefault('creationPayload', {}) + request_body['creationPayload']['defaultCollation'] = "Latin1_General_100_CI_AS_KS_WS_SC_UTF8" client = fabric.FabricRestClient() response = client.post( From 19f0afcc255a9228dc540842f35e1f0ab2ed9d22 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 11 Oct 2024 12:18:58 +0200 Subject: [PATCH 2/3] black --- src/sempy_labs/_external_data_shares.py | 4 +++- src/sempy_labs/_warehouses.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/sempy_labs/_external_data_shares.py b/src/sempy_labs/_external_data_shares.py index 47329e7e..a219f336 100644 --- a/src/sempy_labs/_external_data_shares.py +++ b/src/sempy_labs/_external_data_shares.py @@ -171,7 +171,9 @@ def list_external_data_shares_in_item( "Paths": [i.get("paths")], "Creator Principal Id": i.get("creatorPrincipal", {}).get("id"), "Creator Principal Type": i.get("creatorPrincipal", {}).get("type"), - "Recipient User Principal Name": i.get("recipient", {}).get("userPrincipalName"), + "Recipient User Principal Name": i.get("recipient", {}).get( + "userPrincipalName" + ), "Status": i.get("status"), "Expiration Time UTC": i.get("expriationTimeUtc"), "Workspace Id": i.get("workspaceId"), diff --git a/src/sempy_labs/_warehouses.py b/src/sempy_labs/_warehouses.py index c994c1aa..4aa397b1 100644 --- a/src/sempy_labs/_warehouses.py +++ b/src/sempy_labs/_warehouses.py @@ -11,7 +11,10 @@ def create_warehouse( - warehouse: str, description: Optional[str] = None, case_insensitive_collation: bool = False, workspace: Optional[str] = None + warehouse: str, + description: Optional[str] = None, + case_insensitive_collation: bool = False, + workspace: Optional[str] = None, ): """ Creates a Fabric warehouse. @@ -37,8 +40,10 @@ def create_warehouse( if description: request_body["description"] = description if case_insensitive_collation: - request_body.setdefault('creationPayload', {}) - request_body['creationPayload']['defaultCollation'] = "Latin1_General_100_CI_AS_KS_WS_SC_UTF8" + request_body.setdefault("creationPayload", {}) + request_body["creationPayload"][ + "defaultCollation" + ] = "Latin1_General_100_CI_AS_KS_WS_SC_UTF8" client = fabric.FabricRestClient() response = client.post( From 1b960be23c9423a949962045b8c516f9c51bae49 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 11 Oct 2024 12:41:22 +0200 Subject: [PATCH 3/3] updated readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76798dac..939ecca8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ Semantic Link Labs is a Python library designed for use in [Microsoft Fabric not * [Check Direct Lake Guardrails](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.lakehouse.html#sempy_labs.lakehouse.get_lakehouse_tables) * [Refresh](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Semantic%20Model%20Refresh.ipynb), [clear cache](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.clear_cache), [backup](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.backup_semantic_model), [restore](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.restore_semantic_model), [copy backup files](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.copy_semantic_model_backup_file), [move/deploy across workspaces](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.deploy_semantic_model) * [Run DAX queries which impersonate a user](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.evaluate_dax_impersonation) - * Manage [Query Scale Out](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Query%20Scale%20Out.ipynb). + * [Manage Query Scale Out](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Query%20Scale%20Out.ipynb). + * [Auto-generate descriptions for any/all measures in bulk](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.tom.html#sempy_labs.tom.TOMWrapper.generate_measure_descriptions) * Reports * [Report Best Practice Analyzer (BPA)](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.report.html#sempy_labs.report.run_report_bpa) * [View report metadata](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Report%20Analysis.ipynb) @@ -30,6 +31,7 @@ Semantic Link Labs is a Python library designed for use in [Microsoft Fabric not * [Rebind reports](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.report.html#sempy_labs.report.report_rebind) * Capacities * [Migrating a Power BI Premium capacity (P sku) to a Fabric capacity (F sku)](https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Capacity%20Migration.ipynb) + * [Create](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.create_fabric_capacity)/[update](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.update_fabric_capacity)/[suspend](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.suspend_fabric_capacity)/[resume](https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html#sempy_labs.resume_fabric_capacity) Fabric capacities. * APIs * Wrapper functions for [Power BI](https://learn.microsoft.com/rest/api/power-bi/), [Fabric](https://learn.microsoft.com/rest/api/fabric/articles/using-fabric-apis), and [Azure](https://learn.microsoft.com/rest/api/azure/?view=rest-power-bi-embedded-2021-01-01) APIs