OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Accessing execution_date inside a function


I am using TimeDeltaSensor and would like to pass a delta value that
depends on the execution_date. The delta depends on the day of the week of
the execution_date.

        wait_for_data = TimeDeltaSensor(
            task_id="wait_for_data",
            delta=get_delta(),
            poke_interval=60 * 10,
            timeout=60 * 60 * (24 * 7 + 2),
            retries=10,
            dag=dag)

Is it possible to access the execution_date from inside the get_delta
function? How?

Thanks,

Pedro