You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/10/14 14:38:56 UTC

[PR] Convert duration strings to timedeltas in YAML Dags [airflow]

pierrejeambrun opened a new pull request, #74742:
URL: https://github.com/apache/airflow/pull/74742

   YAML has no duration type, so a YAML Dag with `retry_delay: "5m"` failed to import with `TypeError: unsupported type for timedelta seconds component: str`. Arguments that only accept a `timedelta`, such as `execution_timeout`, `dagrun_timeout` or `TimeDeltaSensor.delta`, could not be set from YAML at all. The importer's own example fixture (`example_dag.yaml`) already uses `retry_delay: "5m"` and `delta: "1h"`, but its tests only parse it and never build it, so this went unnoticed. Found while testing the language SDKs on 3.4.0b1.
   
   The builder already promotes date strings for `datetime`-annotated arguments. This applies the same annotation-based approach to `timedelta`-annotated arguments, accepting durations written as `30s`, `5m`, `1h30m` or `2d` on the Dag, at task level and under `with:`. Only arguments annotated as `timedelta` are touched, and any other string is passed through unchanged, as for dates.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Convert duration strings to timedeltas in YAML Dags [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #74742:
URL: https://github.com/apache/airflow/pull/74742#issuecomment-6173009067

   TP is working on a wider support for this, closing


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Convert duration strings to timedeltas in YAML Dags [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #74742: Convert duration strings to timedeltas in YAML Dags
URL: https://github.com/apache/airflow/pull/74742


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org