PowerBIDatasetRefreshOperator

Operator for refreshing a Power BI dataset (semantic model), optionally waiting for its Fabric capacity.

class scamander.providers.fabric.operators.powerbi_operator.PowerBIDatasetRefreshOperator(*, group_id: str, dataset_id: str, fabric_conn_id: str, fabric_capacity_conn_id: str = 'fabric_capacity_default', subscription_id: str | None = None, resource_group: str | None = None, capacity_name: str | None = None, check_interval: int = 60, capacity_check_interval: int = 600, timeout: int = 604800, **kwargs)

Basisklassen: BaseOperator

Refresh a Power BI dataset and wait (deferred) until the refresh completes.

When subscription_id, resource_group and capacity_name are given, the operator first waits until that Fabric capacity is Active. If the capacity goes down during the refresh (ModelRefreshDisabled), it waits for the capacity again and starts a new refresh. Leave them out for datasets on shared capacity. Any other refresh failure fails the task without retries.

capacity_active(context: Context, event: dict, end_time: float) → None

Callback for when FabricCapacityTrigger (wait_for_active) fires.

Parameters:
  • context – The Airflow task execution context.

  • event – The trigger event payload, with status and message keys.

  • end_time – Unix timestamp of the task deadline.

Veroorzaakt:

AirflowFailException – If the capacity did not become Active in time.

property capacity_hook: FabricCapacityHook

Create and return the FabricCapacityHook (cached).

execute(context: Context) → None

Start the refresh once the capacity (if any) is Active, then defer until it terminates.

Parameters:

context – The Airflow task execution context.

execute_complete(context: Context, event: dict, end_time: float) → str

Callback for when PowerBIDatasetRefreshTrigger fires.

Parameters:
  • context – The Airflow task execution context.

  • event – The trigger event payload, with status, request_id, refresh_status, error_code and message keys.

  • end_time – Unix timestamp of the task deadline.

Returns:

The request Id of the completed refresh.

Veroorzaakt:

AirflowFailException – If the refresh failed for a reason other than the capacity going down, or the deadline has passed.

property hook: FabricHook

Create and return the FabricHook with the Power BI scope (cached).

property should_check_capacity: bool

Whether the dataset lives on a Fabric capacity that must be Active before refreshing.