jroachgolf84 opened a new pull request, #63210:
URL: https://github.com/apache/airflow/pull/63210

   ## Description
   
   The `SQLTableCheckOperator` validates if certain conditions are met for a 
table. However, if this table is empty, all of these checks would fail. The 
`accept_none` parameter allows for a user to specify if an empty table should 
not trigger failures if the table is empty.
   
   Example usage:
   
   ```python
   ...
   
   row_count_check = SQLTableCheckOperator(
       task_id="row_count_check",
       table=my_table,
       checks={
           "row_count_check": {
               "check_statement": "COUNT(*) = 1",
           }
       },
       accept_none=True
   )
   
   ...
   ```
   
   ## Testing
   
   There were two unit tests added as part of these changes. These test setting 
`accept_none` to both `True` and `False`. To run these tests, run the commands 
below.
   
   
   ```bash
   git fetch origin
   get checkout origin/issue-30082
   git pull
   
   breeze testing providers-tests 
providers/common/sql/tests/unit/common/sql/operators/test_sql.py::TestTableCheckOperator
   ```
   
   closes: #30082
   
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to