Skip to content

Fix airflowctl commands failing against older Airflow servers - #70954

Draft
Lee-W wants to merge 1 commit into
apache:mainfrom
astronomer:airflowctl-tolerate-older-server
Draft

Fix airflowctl commands failing against older Airflow servers#70954
Lee-W wants to merge 1 commit into
apache:mainfrom
astronomer:airflowctl-tolerate-older-server

Conversation

@Lee-W

@Lee-W Lee-W commented Aug 3, 2026

Copy link
Copy Markdown
Member

airflowctl's datamodels are generated from the newest Airflow API spec, so a server on an older Airflow line legitimately omits fields the models declare as required. Collection responses already tolerated that via fill_missing_fields, added in #63388 for exactly this reason, but only inside execute_list. Every single-object response validated strictly, so commands such as dags get-details, dags unpause and dags update failed:

ValidationError: 2 validation errors for DAGResponse
  is_backfillable      Field required
  timetable_periodic   Field required

against any Airflow older than the line the models were generated from.

Lift the validation out of execute_list into a shared validate_response() and use it for all 46 single-object responses. LoginOperations keeps strict validation on purpose — a defaulted token should fail loudly rather than be filled in.


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

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

airflowctl's datamodels are generated from the newest Airflow API spec, so
a server on an older Airflow line legitimately omits fields the models
declare as required. Collection responses already tolerated that via
fill_missing_fields, added in apache#63388 for exactly this reason, but only
inside execute_list. Every single-object response validated strictly, so
commands such as dags get-details, dags unpause and dags update failed:

    ValidationError: 2 validation errors for DAGResponse
      is_backfillable      Field required
      timetable_periodic   Field required

against any Airflow older than the line the models were generated from.

Lift the validation out of execute_list into a shared validate_response()
and use it for all 46 single-object responses. LoginOperations keeps strict
validation on purpose — a defaulted token should fail loudly rather than be
filled in.
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.

1 participant