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)¶
Bases:
BaseOperatorRefresh a Power BI dataset and wait (deferred) until the refresh completes.
When
subscription_id,resource_groupandcapacity_nameare given, the operator first waits until that Fabric capacity isActive. 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
statusandmessagekeys.end_time – Unix timestamp of the task deadline.
- Raises:
AirflowFailException – If the capacity did not become
Activein 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
PowerBIDatasetRefreshTriggerfires.- Parameters:
context – The Airflow task execution context.
event – The trigger event payload, with
status,request_id,refresh_status,error_codeandmessagekeys.end_time – Unix timestamp of the task deadline.
- Returns:
The request Id of the completed refresh.
- Raises:
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
Activebefore refreshing.