Skip to content

Error with TimeSensor and deferrable=True #53591

@zerodarkzone

Description

@zerodarkzone

Apache Airflow version

3.0.3

If "Other Airflow 2 version" selected, which one?

No response

What happened?

When using the TimeSensor operator with deferrable = True, it fails after completion with the following error:

TypeError: TimeSensor.execute_complete() got an unexpected keyword argument 'event'
File "/usr/local/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py", line 877 in run

File "/usr/local/lib/python3.12/site-packages/airflow/sdk/execution_time/task_runner.py", line 1164 in _execute_task

File "/usr/local/lib/python3.12/site-packages/airflow/sdk/bases/sensor.py", line 255 in resume_execution

File "/usr/local/lib/python3.12/site-packages/airflow/sdk/bases/operator.py", line 1609 in resume_execution

What you think should happen instead?

The operator should finish and continue the dag execution.

How to reproduce

Create a TimeSensor with deferrable=True, it will fail after completion.

_sensor_wait = TimeSensor(
    task_id="wait_for_2_25",
    target_time=time(2, 25).replace(tzinfo=timezone("America/Bogota")),
    deferrable=True,
)

Operating System

Astronomer

Versions of Apache Airflow Providers

No response

Deployment

Astronomer

Deployment details

I'm using astronomer runtime 3.0-5 with the kubernetes executor.

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions