Repository navigation
Make durable flag reach default_args in PowerBIDatasetRefreshOperator - #76793
Conversation
dabla
left a comment
There was a problem hiding this comment.
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_argstest fails below Airflow 3.3 fordurable=Trueand doesn't tell a fixed operator from an unfixed one. Suggestion: one below-3.3 test that checks the warning, plus theFalsecheck 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__.
|
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 If it's worth changing, it would be a one-line change in the compat mixin ( |
dabla
left a comment
There was a problem hiding this comment.
Addressed
- The
default_argstest that failed below Airflow 3.3 fordurable=True, and couldn't tell a fixed operator from an unfixed one: fixed in 6b2de641. TheFalsecheck is now gated on 3.3+, and a new below-3.3 test asserts thatdefault_args={"durable": True}triggers the "durablehas 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 includesmicrosoft.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!
Was generative AI tooling used to co-author this PR?
What
PowerBIDatasetRefreshOperatortakesdurablefromResumableJobMixinand never names it on its own__init__. #71531 gave the other sevenResumableJobMixinoperators that parameter sodefault_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**kwargsinto it.Below 3.3 it does not. The compat
ResumableJobMixin.__init__has no_apply_defaultswrapper, sodefault_argsnever reachesdurable. Setting it there is silently dropped, and the "durablehas no effect on Airflow versions below 3.3" warning never fires.Proposed change
Name
durable: bool | None = Noneon the operator and forward it when it is set, the same threelines
RedshiftDataOperatorandLivyOperatoralready use.No behaviour change on 3.3+. The default stays on, since
Noneleaves the mixin'sdurable=Truein place.
{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.