You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/21 00:48:40 UTC

[GitHub] [airflow] uranusjr commented on issue #25207: Create custom DAG classes with custom `clear` etc.

uranusjr commented on issue #25207:
URL: https://github.com/apache/airflow/issues/25207#issuecomment-1190913015

   Instead of overriding the class, it seems like something like an _on-clear hook_ would be more suitable? Say (illustrative only)
   
   ```python
   def on_dag_clear(dag: DAG) -> None:
       # Do something here...
   
   dag = DAG(..., on_clear=on_dag_clear)
   ```
   
   So the function is called when the DAG is cleared. We generally don’t want to allow the user to override behaviour in DAG because it’s executed directly in the Airflow process, and bad code can easily hang or even crash Airflow entirely.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org