ashb commented on code in PR #23592:
URL: https://github.com/apache/airflow/pull/23592#discussion_r935695857


##########
airflow/models/dag.py:
##########
@@ -312,6 +316,7 @@ class DAG(LoggingMixin):
         ``Environment`` is used to render templates as string values.
     :param tags: List of tags to help filtering DAGs in the UI.
     :param schedule_on: List of upstream datasets if for use in triggering DAG 
runs.
+    :param auto_register: Automatically register this DAG when it is used in a 
``with`` block

Review Comment:
   It's only relevant to context manager yes, but this is the only place you 
can add a flag to change the behavoiur of _one_ dag.
   
   I think we could add a new config flag (default to True) that globally sets 
the auto_register behaviour, but I think we still need the way to change the 
behaviour for a single dag.
   
   The other option I can think of is this:
   
   ```python
   with DAG(dag_id=...).with_autoregister(False):
       ...
   ```
   
   I don't have a strong preference either way



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