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 2021/09/02 00:41:45 UTC

[GitHub] [airflow] SamWheating commented on a change in pull request #17963: Improve the description of how to handle dynamic task generation

SamWheating commented on a change in pull request #17963:
URL: https://github.com/apache/airflow/pull/17963#discussion_r700664148



##########
File path: docs/apache-airflow/best-practices.rst
##########
@@ -124,10 +124,63 @@ Airflow parses the Python file. For more information, see: :ref:`managing_variab
 Top level Python Code
 ---------------------
 
-In general, you should not write any code outside of defining Airflow constructs like Operators. The code outside the
-tasks runs every time Airflow parses an eligible python file, which happens at the minimum frequency of
+You should avoid writing the top level code which is not necessary to create Operators
+and build DAG relations between them. Specifically you should not run any database access,
+heavy computations and networking operations. The code outside the Operator's ``execute`` methods
+runs every time Airflow parses an eligible python file, which happens at the minimum frequency of
 :ref:`min_file_process_interval<config:scheduler__min_file_process_interval>` seconds.

Review comment:
       ```suggestion
   runs every time Airflow parses an eligible python file, which happens at the maximum frequency of once every
   :ref:`min_file_process_interval<config:scheduler__min_file_process_interval>` seconds.
   ```
   
   I think that the minimum frequency is unbounded, while the maximum parsing frequency is determined by `min_file_process_interval`.
   




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