Skip to content

Conversation

@jameshyphen
Copy link
Contributor

@jameshyphen jameshyphen commented May 27, 2025

Description

Allow TimeDeltaSensor to act as a deferrable by consuming a feature flag.
Added a deprecation warning for TimeDeltaSensorAsync to nudge users to use TimeDeltaSensor with deferrable=True instead.

Tests

  • Added a test to verify that the time delta sensor has deferred once with a DateTimeTrigger when flag is enabled

Related Issues

Closes #50811

Checklist

  • Code follows Airflow's style and guidelines
  • Tests have been added
  • No backward-incompatible changes introduced

@boring-cyborg
Copy link

boring-cyborg bot commented May 27, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@jameshyphen jameshyphen force-pushed the feat_merge-timedeltasensor-async branch from 0013061 to 76d640f Compare May 27, 2025 19:54
@jameshyphen jameshyphen force-pushed the feat_merge-timedeltasensor-async branch 3 times, most recently from 2919606 to 8920c7b Compare May 28, 2025 21:35
@jameshyphen jameshyphen force-pushed the feat_merge-timedeltasensor-async branch from eb8e0bc to b5f7512 Compare May 29, 2025 01:34
@jameshyphen jameshyphen requested a review from mobuchowski as a code owner May 29, 2025 08:30
@jameshyphen jameshyphen force-pushed the feat_merge-timedeltasensor-async branch from b5b556f to 39ac8ac Compare May 29, 2025 08:31
@eladkal
Copy link
Contributor

eladkal commented May 29, 2025

merging. Test failures are not related to this PR

@eladkal eladkal merged commit a898a1b into apache:main May 29, 2025
95 of 96 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented May 29, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@potiuk potiuk added this to the Airflow 3.0.2 milestone May 29, 2025
@potiuk
Copy link
Member

potiuk commented May 29, 2025

If the #51192 is merged + cherry-picked to 3.0.2 -> we should also cherry-pick this one to get latest standard provider examples.

sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
* feat: merge TimeDeltaSensorAsync to TimeDeltaSensor

* feat: add a test for deferrable TimeDeltaSensor

* feat: add example, simplify code in TimeDeltaSensor (as per TimeSensor)

* feat: PR comments & adapt failing tests due to deprecation

* feat: get rid of airflow_venv/ from gitignore

* feat: remove unused variables

* Update providers/standard/src/airflow/providers/standard/sensors/time_delta.py

Co-authored-by: Wei Lee <weilee.rx@gmail.com>

* feat: resolve test errors

---------

Co-authored-by: Wei Lee <weilee.rx@gmail.com>
jose-lehmkuhl pushed a commit to jose-lehmkuhl/airflow that referenced this pull request Jul 11, 2025
* feat: merge TimeDeltaSensorAsync to TimeDeltaSensor

* feat: add a test for deferrable TimeDeltaSensor

* feat: add example, simplify code in TimeDeltaSensor (as per TimeSensor)

* feat: PR comments & adapt failing tests due to deprecation

* feat: get rid of airflow_venv/ from gitignore

* feat: remove unused variables

* Update providers/standard/src/airflow/providers/standard/sensors/time_delta.py

Co-authored-by: Wei Lee <weilee.rx@gmail.com>

* feat: resolve test errors

---------

Co-authored-by: Wei Lee <weilee.rx@gmail.com>
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.

Merge TimeDeltaSensorAsync to TimeDeltaSensor

4 participants