Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

@amoghrajesh amoghrajesh commented May 21, 2025

Main is failing with errors like these:

_ TestTimeDeltaSensorAsync.test_timedelta_sensor_async_run_after_vs_interval[run_after0-interval_end0] _
providers/standard/tests/unit/standard/sensors/test_time_delta.py:185: in test_timedelta_sensor_async_run_after_vs_interval
    op.execute(context)
/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py:424: in wrapper
    return func(self, *args, **kwargs)
/usr/local/lib/python3.9/site-packages/airflow/providers/standard/sensors/time_delta.py:137: in execute
    self.defer(
/usr/local/lib/python3.9/site-packages/airflow/models/baseoperator.py:1800: in defer
    raise TaskDeferred(trigger=trigger, method_name=method_name, kwargs=kwargs, timeout=timeout)
/usr/local/lib/python3.9/site-packages/airflow/exceptions.py:431: in __init__
    raise ValueError("Timeout value must be a timedelta")
E   ValueError: Timeout value must be a timedelta
  • In 2.11, timeout must be a timedelta | None

  • In 3.0, timeout can be timedelta | int | float | None

It seems the conditional is wrong and should be flipped

Example failures: https://github.com/apache/airflow/actions/runs/15152977665/job/42602642810


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@amoghrajesh amoghrajesh changed the title Remove 2.11 backcompat code in time delta operators to fix CI Fix backward compatibility for timeout in defer() with Airflow 2.11 May 21, 2025
@amoghrajesh amoghrajesh self-assigned this May 21, 2025
@amoghrajesh amoghrajesh requested a review from eladkal May 21, 2025 06:50
@eladkal eladkal merged commit 3e6fc38 into apache:main May 21, 2025
95 checks passed
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request May 21, 2025
…pache#50869)

* Remove 2.11 backcompat code in time delta operators to fix CI

* fix compat logic
dadonnelly316 pushed a commit to dadonnelly316/airflow that referenced this pull request May 26, 2025
…pache#50869)

* Remove 2.11 backcompat code in time delta operators to fix CI

* fix compat logic
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
…pache#50869)

* Remove 2.11 backcompat code in time delta operators to fix CI

* fix compat logic
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.

4 participants