durch opened a new pull request #5488: Add success, failure and fail_on_empty 
params to SqlSensor
URL: https://github.com/apache/airflow/pull/5488
 
 
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   This PR enhances `SqlSensor` with three additional parameters that allow for 
fine tuning of usage.
   + **success** and **failure** parameters allow for passing in an iterable of 
values against which the `first_cell` is checked. In case of `success` the 
sensor keeps poking until `first_cell` is found in the `success` iterable. In 
case of `failure` an `AirflowException` is raised if `first_cell` is found in 
the`failure` iterable. `first_cell` is matched against `failure` iterable first.
   + if **fail_on_empty** parameter is set to `True` an `AirflowException` is 
raised in case of no rows returned.
   
   ### Tests
   
   - [x] My PR adds the following unit tests:
   + `test_sql_sensor_postgres_poke_fail_on_empty`
   + `test_sql_sensor_postgres_poke_success`
   + `test_sql_sensor_postgres_poke_failure`
   + `test_sql_sensor_postgres_poke_failure_success`
   + `test_sql_sensor_postgres_poke_failure_success_same`
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - All the public functions and the classes in the PR contain docstrings 
that explain what it does
     - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [x] Passes `flake8`
   

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

Reply via email to