Skip to content

Implement delta argument coercion - #74749

Merged
uranusjr merged 1 commit into
apache:mainfrom
astronomer:yaml-magic-period-string
Oct 15, 2026
Merged

uranusjr merged 1 commit into
apache:mainfrom
astronomer:yaml-magic-period-string

Conversation

@uranusjr

Copy link
Copy Markdown
Member

@pierrejeambrun reminded me we forgot to implement the timedelta syntax in the YAML Dag format. This PR fixes that.

Two format coercions are added (in addition to datetime coercion, already implemented and refactored into a more generic code path):

  • A human-friendly shorthand duration string, e.g. 1h5m. This is parsed into a timedelta unless y and mo are used (timedelta only supports up to days)
  • ISO 8601 time interval with a P prefix e.g. P1Y2M10DT2H30M. This is parsed into a relativedelta as supported by some Airflow arguments.

Similar to datetime parsing, this only kicks in if an argument is annotated to accept either timedelta or relativedelta.

@uranusjr uranusjr added backport-to-v3-4-test Backport to v3-4-test AIP-85: Dag Importer https://cwiki.apache.org/confluence/spaces/AIRFLOW/pages/315494137/AIP-85+DAG+importer labels Oct 14, 2026
@uranusjr uranusjr added this to the Airflow 3.3.3 milestone Oct 14, 2026
@uranusjr uranusjr moved this from Todo to In Progress in AIP-85 Dag Importer Oct 14, 2026
@uranusjr uranusjr modified the milestones: Airflow 3.3.3, Airflow 3.4.0 Oct 14, 2026

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks code looks good to me.

(Reviewed from my phone, couldn't test this locally)

@uranusjr
uranusjr merged commit 5b32faf into apache:main Oct 15, 2026
108 checks passed
@uranusjr
uranusjr deleted the yaml-magic-period-string branch October 15, 2026 08:16
@github-project-automation github-project-automation Bot moved this from In Progress to Done in AIP-85 Dag Importer Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 18, 2026
(cherry picked from commit 5b32faf)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 19, 2026
(cherry picked from commit 5b32faf)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
(cherry picked from commit 5b32faf)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-85: Dag Importer https://cwiki.apache.org/confluence/spaces/AIRFLOW/pages/315494137/AIP-85+DAG+importer backport-to-v3-4-test Backport to v3-4-test

Projects

Development

Successfully merging this pull request may close these issues.

2 participants