Skip to content

Instantly share code, notes, and snippets.

@MarkPryceMaherMSFT
Last active November 30, 2024 10:53
Show Gist options
  • Save MarkPryceMaherMSFT/2f26b7317e43a014bce0bad5480b9255 to your computer and use it in GitHub Desktop.
Save MarkPryceMaherMSFT/2f26b7317e43a014bce0bad5480b9255 to your computer and use it in GitHub Desktop.
Create Fabric warehouse with case insensitive collation
# details from Article : https://learn.microsoft.com/en-us/fabric/data-warehouse/collation
# default collation is Latin1_General_100_BIN2_UTF8
# new collation is Latin1_General_100_CI_AS_KS_WS_SC_UTF8
#sempy version 0.4.0 or higher
!pip install semantic-link --q
import json
import sempy.fabric as fabric
from sempy.fabric.exceptions import FabricHTTPException, WorkspaceNotFoundException
workspace_id=spark.conf.get("trident.workspace.id")
#Instantiate the client
client = fabric.FabricRestClient()
uri = f"https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/items"
payload = {
"type": "Warehouse",
"displayName": "CaseInsensitiveAPIDemo",
"description": "New warehouse with case-insensitive collatio2n",
"creationPayload": {
"defaultCollation": "Latin1_General_100_CI_AS_KS_WS_SC_UTF8"
}
}
# Call the REST API
response = client.post(uri,json= payload)
display(response)
#data = json.loads(response.text)
#display(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment