You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "atul-astronomer (via GitHub)" <gi...@apache.org> on 2025/03/13 09:51:09 UTC

[I] DayOfWeekSensor is failing when logical date is null and argument 'use_task_logical_date' is True [airflow]

atul-astronomer opened a new issue, #47717:
URL: https://github.com/apache/airflow/issues/47717

   ### Apache Airflow version
   
   3.0.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   DayOfWeekSensor is failing when logical date is null and argument 'use_task_logical_date' is True 
   
    - Task failed with exception logger="task" error_detail=[{"exc_type":"KeyError","exc_value":"'logical_date'","syntax_error":null,"is_cause":false,"frames":[{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py","lineno":609,"name":"run"},{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py","lineno":730,"name":"_execute_task"},{"filename":"/opt/airflow/airflow/models/baseoperator.py","lineno":168,"name":"wrapper"},{"filename":"/opt/airflow/airflow/sensors/base.py","lineno":287,"name":"execute"},{"filename":"/opt/airflow/airflow/sensors/base.py","lineno":267,"name":"execute"},{"filename":"/opt/airflow/providers/standard/src/airflow/providers/standard/sensors/weekday.py","lineno":107,"name":"poke"}]}]
   
   ### What you think should happen instead?
   
   DayOfWeekSensor should work with null logical date and argument 'use_task_logical_date'=True 
   
   ### How to reproduce
   
   Run the below DAG:
   
   `from pendulum import today
   
   from airflow import DAG
   from airflow.providers.standard.sensors.weekday import DayOfWeekSensor
   
   with DAG(
       "example_week_sensor",
       schedule=None,
       start_date=today('UTC').add(days=-2),
       tags=[ "sensor"],
   ) as dag:
       working_day_check = DayOfWeekSensor(
           task_id="working_day_check",
           # added weekend days so that no matter what any day of the week this sensor will work.
           week_day={"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"},
           use_task_logical_date=True,
           poke_interval=20.0,
           timeout=120.0,
           dag=dag,
       )
   `
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] DayOfWeekSensor is failing when logical date is null and argument 'use_task_logical_date' is True [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil closed issue #47717: DayOfWeekSensor is failing when logical date is null and argument 'use_task_logical_date' is True
URL: https://github.com/apache/airflow/issues/47717


-- 
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: [I] DayOfWeekSensor is failing when logical date is null and argument 'use_task_logical_date' is True [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil closed issue #47717: DayOfWeekSensor is failing when logical date is null and argument 'use_task_logical_date' is True
URL: https://github.com/apache/airflow/issues/47717


-- 
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