PowerBI (dagster-powerbi)
Dagster allows you to represent your PowerBI Workspaces as assets, alongside other your other technologies like dbt and Sling. This allows you to see how your PowerBI assets are connected to your other data assets, and how changes to other data assets might impact your PowerBI Workspaces.
PowerBI API
Here, we provide interfaces to manage PowerBI Workspaces using the PowerBI API.
Assets (PowerBI)
class
dagster_powerbi.PowerBIServicePrincipalAuthenticates with PowerBI using a service principal.
class
dagster_powerbi.PowerBITokenAuthenticates with PowerBI directly using an API access token.
class
dagster_powerbi.PowerBIWorkspaceRepresents a workspace in PowerBI and provides utilities to interact with the PowerBI API.
- build_defs
- deprecated
This API will be removed in version 1.9.0. Use dagster_powerbi.load_powerbi_asset_specs instead.
Returns a Definitions object which will load Power BI content from the workspace and translate it into assets, using the provided translator.
Parameters:
- context (Optional[DefinitionsLoadContext]) – The context to use when loading the definitions. If not provided, retrieved contextually.
- dagster_powerbi_translator (Type[DagsterPowerBITranslator]) – The translator to use to convert Power BI content into AssetSpecs. Defaults to DagsterPowerBITranslator.
- enable_refresh_semantic_models (bool) – Whether to enable refreshing semantic models by materializing them in Dagster.
Returns: A Definitions object which will build and return the Power BI content.Return type: Definitions
- poll_refresh
Polls the refresh status of a PowerBI dataset until it completes or fails.
- trigger_and_poll_refresh
Triggers a refresh of a PowerBI dataset and polls until it completes or fails.
- trigger_refresh
Triggers a refresh of a PowerBI dataset.
class
dagster_powerbi.DagsterPowerBITranslatorTranslator class which converts raw response data from the PowerBI API into AssetSpecs. Subclass this class to implement custom logic for each type of PowerBI content.
- dagster_powerbi.load_powerbi_asset_specs
- beta
This API is currently in beta, and may have breaking changes in minor version releases, with behavior changes in patch releases.
Returns a list of AssetSpecs representing the Power BI content in the workspace.
Parameters:
- workspace (PowerBIWorkspace) – The Power BI workspace to load assets from.
- dagster_powerbi_translator (Optional[Union[DagsterPowerBITranslator, Type[DagsterPowerBITranslator]]]) – The translator to use to convert Power BI content into
dagster.AssetSpec
. Defaults toDagsterPowerBITranslator
. - use_workspace_scan (bool) – Whether to scan the entire workspace using admin APIs at once to get all content. Defaults to True.
Returns: The set of assets representing the Power BI content in the workspace.Return type: List[AssetSpec]
- dagster_powerbi.build_semantic_model_refresh_asset_definition
- beta
This API is currently in beta, and may have breaking changes in minor version releases, with behavior changes in patch releases.
Builds an asset definition for refreshing a PowerBI semantic model.