ashb commented on a change in pull request #6336: [AIRFLOW-5073] Change 
SQLSensor to optionally treat NULL as keep poking
URL: https://github.com/apache/airflow/pull/6336#discussion_r335560715
 
 

 ##########
 File path: airflow/sensors/sql_sensor.py
 ##########
 @@ -103,5 +103,5 @@ def poke(self, context):
             else:
                 raise AirflowException("self.success is present, but not 
callable -> {}".format(self.success))
         if self.allow_null:
-            return str(first_cell) not in ('0', '')
-        return str(first_cell) not in ('0', '', 'None')
+            return not (first_cell is not None or str(first_cell) == '' or 
int(first_cell) == 0)
 
 Review comment:
   I'm not a fan of double-negatives. I think this is easier to understand 
without them. I think this works and carries the same meaning?
   
   ```suggestion
               return first_cell is None or first_cell != '' or first_cell != 0
   ```
   
   We don't want 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to