You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "raphaelauv (via GitHub)" <gi...@apache.org> on 2026/08/07 20:03:50 UTC
[PR] TimeDeltaSensor - delta templated [airflow]
raphaelauv opened a new pull request, #71314:
URL: https://github.com/apache/airflow/pull/71314
this will allow to put a `delta` templated value
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "seanghaeli (via GitHub)" <gi...@apache.org>.
seanghaeli commented on PR #71314:
URL: https://github.com/apache/airflow/pull/71314#issuecomment-5334422087
Looks good, add an error path test similar to what https://github.com/apache/airflow/pull/70480 has
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #71314:
URL: https://github.com/apache/airflow/pull/71314#issuecomment-5601710441
### Backport failed to create: v3-3-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/34350166211'> Run details </a>
Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
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](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>❌</td>
<td>v3-3-test</td>
<td><a href="https://github.com/apache/airflow/commit/3b9df4f8c93a8fef16b0470863b782d82b613994"><img src='https://img.shields.io/badge/Commit-3b9df4f-red' alt='Commit Link'></a></td>
</tr>
</table>
You can attempt to backport this manually by running:
```bash
cherry_picker 3b9df4f v3-3-test
```
This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.
After you have resolved the conflicts, you can continue the backport process by running:
```bash
cherry_picker --continue
```
If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README.md#how-to-backport-pr-with-cherry-picker-cli).
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on code in PR #71314:
URL: https://github.com/apache/airflow/pull/71314#discussion_r3803619272
##########
providers/standard/src/airflow/providers/standard/sensors/time_delta.py:
##########
@@ -70,6 +72,12 @@ def __init__(
self.deferrable = deferrable
self.end_from_trigger = end_from_trigger
+ def _resolve_delta(self) -> timedelta:
+ value = self.delta
+ if isinstance(value, timedelta):
+ return value
+ return timedelta(minutes=int(value))
Review Comment:
Why did you choose minutes for this (rather than days, or seconds) -- and why int, not float?
Either way, accepting this needs to be documented.
Also, although it's not commonly known, there is a way of expressing intervals/periods/delta with Pendulum via ISO8061:
> ISO 8601 Durations are expressed using the following format, where (n) is replaced by the value for each of the date and time elements that follow the (n):
>
> P(n)Y(n)M(n)DT(n)H(n)M(n)S
>
> Where:
>
> P is the duration designator (referred to as "period"), and is always placed at the beginning of the duration.
> Y is the year designator that follows the value for the number of years.
> M is the month designator that follows the value for the number of months.
> W is the week designator that follows the value for the number of weeks.
> D is the day designator that follows the value for the number of days.
> T is the time designator that precedes the time components.
> H is the hour designator that follows the value for the number of hours.
> M is the minute designator that follows the value for the number of minutes.
> S is the second designator that follows the value for the number of seconds.
>
> For example:
>
> P3Y6M4DT12H30M5S
>
> Represents a duration of three years, six months, four days, twelve hours, thirty minutes, and five seconds.
```pycon
>>> import pendulum
>>> pendulum.parse("P3Y6M4DT12H30M5S")
Duration(years=3, months=6, days=4, hours=12, minutes=30, seconds=5)
```
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on code in PR #71314:
URL: https://github.com/apache/airflow/pull/71314#discussion_r3811936386
##########
providers/standard/src/airflow/providers/standard/sensors/time_delta.py:
##########
@@ -70,6 +72,12 @@ def __init__(
self.deferrable = deferrable
self.end_from_trigger = end_from_trigger
+ def _resolve_delta(self) -> timedelta:
+ value = self.delta
+ if isinstance(value, timedelta):
+ return value
+ return timedelta(minutes=int(value))
Review Comment:
okay I could add this feature in a second PR
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on code in PR #71314:
URL: https://github.com/apache/airflow/pull/71314#discussion_r3804656106
##########
providers/standard/src/airflow/providers/standard/sensors/time_delta.py:
##########
@@ -70,6 +72,12 @@ def __init__(
self.deferrable = deferrable
self.end_from_trigger = end_from_trigger
+ def _resolve_delta(self) -> timedelta:
+ value = self.delta
+ if isinstance(value, timedelta):
+ return value
+ return timedelta(minutes=int(value))
Review Comment:
minutes , because it was the existing choice of the WaitSensor
https://github.com/apache/airflow/pull/70480/changes
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on code in PR #71314:
URL: https://github.com/apache/airflow/pull/71314#discussion_r3803619272
##########
providers/standard/src/airflow/providers/standard/sensors/time_delta.py:
##########
@@ -70,6 +72,12 @@ def __init__(
self.deferrable = deferrable
self.end_from_trigger = end_from_trigger
+ def _resolve_delta(self) -> timedelta:
+ value = self.delta
+ if isinstance(value, timedelta):
+ return value
+ return timedelta(minutes=int(value))
Review Comment:
Why did you choose minutes for this (rather than days, or seconds) -- and why int, not float?
Either way, accepting this needs to be documented.
Also, although it's not commonly known, there is a way of expressing intervals/periods/delta with Pendulum via ISO8061:
> ISO 8601 Durations are expressed using the following format, where (n) is replaced by the value for each of the date and time elements that follow the (n):
>
> P(n)Y(n)M(n)DT(n)H(n)M(n)S
>
> Where:
>
> P is the duration designator (referred to as "period"), and is always placed at the beginning of the duration.
> Y is the year designator that follows the value for the number of years.
> M is the month designator that follows the value for the number of months.
> W is the week designator that follows the value for the number of weeks.
> D is the day designator that follows the value for the number of days.
> T is the time designator that precedes the time components.
> H is the hour designator that follows the value for the number of hours.
> M is the minute designator that follows the value for the number of minutes.
> S is the second designator that follows the value for the number of seconds.
>
> For example:
>
> P3Y6M4DT12H30M5S
>
> Represents a duration of three years, six months, four days, twelve hours, thirty minutes, and five seconds.
```pycon
>>> import pendulum
>>> pendulum.parse("P3Y6M4DT12H30M5S")
Duration(years=3, months=6, days=4, hours=12, minutes=30, seconds=5)
>>> pendulum.parse("PT6000S")
Duration(hours=1, minutes=40)
```
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on code in PR #71314:
URL: https://github.com/apache/airflow/pull/71314#discussion_r3804661663
##########
providers/standard/src/airflow/providers/standard/sensors/time_delta.py:
##########
@@ -70,6 +72,12 @@ def __init__(
self.deferrable = deferrable
self.end_from_trigger = end_from_trigger
+ def _resolve_delta(self) -> timedelta:
+ value = self.delta
+ if isinstance(value, timedelta):
+ return value
+ return timedelta(minutes=int(value))
Review Comment:
I don't understand why you talk about `pendum` `Duration` ?
the operator `TimeDeltaSensor` accept a `datetime.timedelta`
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on PR #71314:
URL: https://github.com/apache/airflow/pull/71314#issuecomment-5340996194
the CI always block on `Install SVN` , I tried two times to re-run it by rebasing and force-push
any idea ?
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "raphaelauv (via GitHub)" <gi...@apache.org>.
raphaelauv commented on PR #71314:
URL: https://github.com/apache/airflow/pull/71314#issuecomment-5345340102
CI is green :) @ashb
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "ashb (via GitHub)" <gi...@apache.org>.
ashb commented on code in PR #71314:
URL: https://github.com/apache/airflow/pull/71314#discussion_r3811555735
##########
providers/standard/src/airflow/providers/standard/sensors/time_delta.py:
##########
@@ -70,6 +72,12 @@ def __init__(
self.deferrable = deferrable
self.end_from_trigger = end_from_trigger
+ def _resolve_delta(self) -> timedelta:
+ value = self.delta
+ if isinstance(value, timedelta):
+ return value
+ return timedelta(minutes=int(value))
Review Comment:
> I don't understand why you talk about pendum Duration ?
Durations/ISO8601 Periods can be represented as plain text, and so are easy to handle via templates.
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #71314:
URL: https://github.com/apache/airflow/pull/71314#issuecomment-5601712822
Not backporting
--
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] TimeDeltaSensor - delta templated [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #71314:
URL: https://github.com/apache/airflow/pull/71314
--
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