airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] ashb commented on a change in pull request #6336: [AIRFLOW-5073] Change SQLSensor to optionally treat NULL as keep poking
Date Wed, 16 Oct 2019 15:51:01 GMT
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_r335561348
 
 

 ##########
 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)
+        return not (first_cell is None or str(first_cell) == '' or int(first_cell) == 0)
 
 Review comment:
   And this one can be
   ```suggestion
           return first_cell is not None and (first_cell != '' or first_cell != 0)
   ```

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


With regards,
Apache Git Services

Mime
View raw message