kani5hk commented on a change in pull request #4878: [AIRFLOW-4046] Added
validations for poke_interval & timeout for Airflow Sensor
URL: https://github.com/apache/airflow/pull/4878#discussion_r264011287
##########
File path: airflow/sensors/base_sensor_operator.py
##########
@@ -70,6 +70,12 @@ def __init__(self,
*args,
**kwargs):
super(BaseSensorOperator, self).__init__(*args, **kwargs)
+ if not isinstance(poke_interval, (int, float)) or poke_interval < 0:
Review comment:
Agree with @XD-DENG, but it may be worth moving to separate method, in a
sense that there are three checks for the argument validation and moving them
to separate method may simplify the `__init__ ` in terms of readability or say
from a cleaner code perspective.
What you guys say? @XD-DENG @mik-laj
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services