Skip to content

Make durable flag reach default_args in PowerBIDatasetRefreshOperator - #76793

Merged
dabla merged 3 commits into
apache:mainfrom
astronomer:powerbi-durable-default-args
Nov 12, 2026
Merged

dabla merged 3 commits into
apache:mainfrom
astronomer:powerbi-durable-default-args

Conversation

@amoghrajesh

Copy link
Copy Markdown
Contributor

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

What

PowerBIDatasetRefreshOperator takes durable from ResumableJobMixin and never names it on its own __init__. #71531 gave the other seven ResumableJobMixin operators that parameter so default_args={"durable": ...} would reach them on every supported Airflow version. PowerBI became durable later, in #74675, and was missed.

Current behaviour

On Airflow 3.3 and later this already works: the SDK ResumableJobMixin.__init__ carries its own _apply_defaults, and the operator forwards **kwargs into it.

Below 3.3 it does not. The compat ResumableJobMixin.__init__ has no _apply_defaults wrapper, so default_args never reaches durable. Setting it there is silently dropped, and the "durable has no effect on Airflow versions below 3.3" warning never fires.

Proposed change

Name durable: bool | None = None on the operator and forward it when it is set, the same three
lines RedshiftDataOperator and LivyOperator already use.

No behaviour change on 3.3+. The default stays on, since None leaves the mixin's durable=True
in place.


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@dabla dabla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Nothing since the previous round. This is the first review, and the PR has no reviews or comments yet.

Open

  • [1] The parametrized default_args test fails below Airflow 3.3 for durable=True and doesn't tell a fixed operator from an unfixed one. Suggestion: one below-3.3 test that checks the warning, plus the False check gated on 3.3+.

The fix itself is right and matches the other ResumableJobMixin operators: named durable: bool | None = None, forwarded only when it isn't None, so the mixin's default stays True. I checked every ResumableJobMixin user on main. PowerBI was the only one without a named durable. MSGraphAsyncOperator and AgentOperator handle durability themselves and already name the parameter. The :param durable: docstring is already there, since #74675.

Pass: diff-based review at 9602106f, with the compat mixin and the sibling operators and tests (Redshift, Livy) read on main. The tests did not run locally. Finding [1] comes from reading the compat mixin's __init__.

@dabla

dabla commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

One more thing, outside this PR's change, so it isn't part of the review. Writing it down so it's on record.

Below Airflow 3.3, the compat ResumableJobMixin warns "durable has no effect on Airflow versions below 3.3" for any explicit value, False included (_resumable_job_mixin.py#L44). With this PR, default_args now reaches durable. So a DAG that sets default_args={"durable": False} to opt out of the durable default gets that warning on every PowerBI task, even though False is exactly what happens on those versions. The other ResumableJobMixin operators from #71531 already do the same. MSGraphAsyncOperator handles durable itself and only warns when it is True (msgraph.py#L181).

If it's worth changing, it would be a one-line change in the compat mixin (if durable: instead of if durable is not None:), in its own PR. Up to you whether to do it.

@amoghrajesh
amoghrajesh requested a review from dabla November 12, 2026 04:09

@dabla dabla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

  • The default_args test that failed below Airflow 3.3 for durable=True, and couldn't tell a fixed operator from an unfixed one: fixed in 6b2de641. The False check is now gated on 3.3+, and a new below-3.3 test asserts that default_args={"durable": True} triggers the "durable has no effect" warning. That warning is the one thing the fix changes below 3.3, so this test fails without the fix. It ran green in the Compat 2.11.1 provider job, which includes microsoft.azure.

Open

Nothing.

The operator change is unchanged since the first round and matches the other ResumableJobMixin operators. The merge from main (31b898c) touches neither the PR's files nor the compat mixin. All CI checks pass, including the Compat 2.11.1, 3.0.6, 3.1.8, 3.2.2, 3.3.2 and 3.4.0 provider jobs. Thanks for the quick turnaround!

@dabla
dabla merged commit c43ff0f into apache:main Nov 12, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants