sempy_labs.semantic_model package

Module contents

sempy_labs.semantic_model.approved_for_copilot(dataset: str | UUID, approved_for_copilot: bool, workspace: str | UUID | None = None)

Turn on this setting to approve your model for Copilot use. This improves visibility in search results and removes the warning in standalone Copilot in Power BI that your organization hasn’t approved the data.

Parameters:
  • dataset (str | uuid.UUID) – The name or UUID of the semantic model.

  • approved_for_copilot (bool) – Set to True to approve the model for Copilot use, or False to disapprove it.

  • workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

sempy_labs.semantic_model.enable_query_caching(dataset: str | UUID, workspace: str | UUID | None = None, enable: bool = True)

Enables or disables query caching for a semantic model.

Parameters:
  • dataset (str | uuid.UUID) – Name or ID of the semantic model.

  • workspace (str | uuid.UUID, default=None) – The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

  • enable (bool, default=True) – Set to True to enable query caching, or False to disable it.

sempy_labs.semantic_model.make_discoverable(dataset: str | UUID, make_discoverable: bool, workspace: str | UUID | None = None)

Allow users without access to this semantic model to discover it and request permissions to access the data. The semantic model must be endorsed as ‘Promoted’, ‘Certified’, or ‘Master data’ to be made discoverable.

Parameters:
  • dataset (str | uuid.UUID) – Name or ID of the semantic model.

  • make_discoverable (bool) – Whether to make the semantic model discoverable.

  • workspace (str | uuid.UUID, default=None) – The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

sempy_labs.semantic_model.set_endorsement(dataset: str | UUID, endorsement: Literal['None', 'Promoted', 'Certified', 'Master data'], workspace: str | UUID | None = None)

Sets the endorsement status for a semantic model.

Parameters:
  • dataset (str | uuid.UUID) – Name or ID of the semantic model.

  • endorsement (Literal["None", "Promoted", "Certified", "Master data"]) – The endorsement status to set for the semantic model.

  • workspace (str | uuid.UUID, default=None) – The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.