matthewblock opened a new issue, #44205:
URL: https://github.com/apache/airflow/issues/44205

   ### Description
   
   Currently, the useful `run_if` and `skip_if` decorators can only be added to 
tasks that are decorated by the `@task` decorator, aka TaskFlow compatible 
operators. However, many common operators are not compatible with TaskFlow API, 
e.g. the `SqlExecuteQueryOperator`. If you try, you will be met with:
   
   ```
   skip_if can only be used with task. decorate with @task before @skip_if.
   ```
   
   This request is for `run_if` and `skip_if` to be added to all operators, not 
just TaskFlow compatible ones.
   
   ### Use case/motivation
   
   I want to use `run_if` and `skip_if` for an operator that isn't TaskFlow 
compatible.
   
   ### Related issues
   
   There is a similar issue that I didn't bookmark to make `@task` decorator 
apply to classes (aka Operators), not just functions. Depending on how that's 
implemented, it could solve this issue.
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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