Skip to content

Make durable reach default_args and warn when set below Airflow 3.3 - #71531

Merged
amoghrajesh merged 2 commits into
apache:mainfrom
astronomer:durable-flag-handling-better
Aug 14, 2026
Merged

amoghrajesh merged 2 commits into
apache:mainfrom
astronomer:durable-flag-handling-better

Conversation

@amoghrajesh

Copy link
Copy Markdown
Contributor

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

durable was left in **kwargs instead of being a named parameter on RedshiftDataOperator, LivyOperator, DatabricksSubmitRunOperator, DatabricksRunNowOperator, BigQueryInsertJobOperator, and SnowflakeSqlApiOperator.

_apply_defaults only fills parameters that are literally named in a decorated __init__, so default_args={"durable": False} silently left durable at its mixin-owned default of True on every one of these operators.

Separately, none of these six operators ever read self.durable outside their own compat stub's __init__, so the value has always been a genuine no-op below Airflow 3.3 because there's no task state store for it to control. But the stub accepted any value silently, with no signal that it did nothing. Now it warns, below 3.3 emits UserWarning: durable has no effect on Airflow versions below 3.3., so nobody mistakes silence for effect.

None of these operators have a legacy flag to fall back on (unlike
Glue's resume_glue_job_on_retry or KPO's reattach_on_restart), so
there's nothing else to resolve -- the warning is the whole fix.


Before / after: durable on Airflow below 3.3

Applies identically to all six operators (RedshiftDataOperator, LivyOperator, DatabricksSubmitRunOperator, DatabricksRunNowOperator, BigQueryInsertJobOperator, SnowflakeSqlApiOperator) — none of them have a legacy flag, and none of them ever read self.durable outside their compat stub, so behavior never changes here. Only the warning is new.

durable passed Behavior (before and after, unchanged) Warning — before Warning — after
not set operator always submits fresh, no task-state-store lookup (below 3.3 doesn't have one) none none
True same — no effect none UserWarning: "durable has no effect on Airflow versions below 3.3."
False same — no effect none UserWarning: "durable has no effect on Airflow versions below 3.3."
default_args Before After
default_args={"durable": False}, no explicit durable kwarg ignored — durable stayed at the mixin's default of True reaches the operator correctly — durable is False

  • 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.

@amoghrajesh
amoghrajesh merged commit f5bd40e into apache:main Aug 14, 2026
155 checks passed
@amoghrajesh
amoghrajesh deleted the durable-flag-handling-better branch August 14, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers full tests needed We need to run full set of tests for this PR to merge kind:documentation provider:amazon AWS/Amazon - related issues provider:apache-livy provider:apache-spark provider:databricks provider:google Google (including GCP) related issues provider:snowflake Issues related to Snowflake provider

Projects

Development

Successfully merging this pull request may close these issues.

2 participants