You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/26 02:19:40 UTC

[GitHub] mik-laj commented on issue #4363: [AIRFLOW-3560] Add WeekEnd & DayOfWeek Sensors

mik-laj commented on issue #4363: [AIRFLOW-3560] Add WeekEnd & DayOfWeek Sensors
URL: https://github.com/apache/incubator-airflow/pull/4363#issuecomment-449889406
 
 
   What do you think about adding support for many days of the week as a parameter (the ability to provide an array)?
   
   Something similar to:
   ```python
   t = DayOfWeekSensor(
                task_id='weekday_sensor_check_true',
                week_day_number=[1,3],
                use_task_execution_day=True,
                dag=self.dag)
   ````
   It also allows you to specify the weekend. 
   
   I think that the change is worth introducing, because the sensor will be much more useful after my proposal but also reduces the number of sensor, which makes the environment more user-friendly.
   
   In the next stage, it is worth expanding these operators with more units ex. DayOfMonth.
   
   In my dream, I would like to see these operators differently. I would like to be able to define simple conditions using an expression
   
   ````
   t = ExpressionCalendarSensor(
                task_id='weekday_sensor_check_true',
                expression="date.isoweekday() == 6 or date..isoweekday() == 7",
                use_task_execution_day=True,
                dag=self.dag)
   ````
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services