You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "erdos2n (via GitHub)" <gi...@apache.org> on 2023/03/11 13:47:31 UTC

[GitHub] [airflow] erdos2n opened a new pull request, #30040: Adding more information regarding top level code

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

   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #30023
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   The changes made to `best-practices.rst` will add more clarity around the idea of top level code in Airflow. This will help users who may not be as familiar with this concept, gain a better understanding of it and why removing or modifying certain aspects of their code from the top level will improve overall performance.
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


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


[GitHub] [airflow] potiuk commented on pull request #30040: Adding more information regarding top level code

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #30040:
URL: https://github.com/apache/airflow/pull/30040#issuecomment-1465003051

   sure - but you need to fix static checks and doc build failures.


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #30040: Adding more information regarding top level code

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #30040:
URL: https://github.com/apache/airflow/pull/30040#discussion_r1133516648


##########
docs/apache-airflow/best-practices.rst:
##########
@@ -166,14 +166,16 @@ Good example:
       @task()
       def print_array():
           """Print Numpy array."""
-          import numpy as np  # <- THIS IS HOW NUMPY SHOULD BE IMPORTED IN THIS CASE
+          import numpy as np  # <- THIS IS HOW NUMPY SHOULD BE IMPORTED IN THIS CASE!
 
           a = np.arange(15).reshape(3, 5)
           print(a)
           return a
 
       print_array()
 
+In the Bad example, numpy is imported everytime the dag file is parsed, which will result in suboptimal performance in the dag file processing. In the Good example, numpy is only imported when the task is running. 

Review Comment:
   ```suggestion
   In the Bad example, NumPy is imported everytime the DAG file is parsed, which will result in suboptimal performance in the DAG file processing. In the Good example, NumPy is only imported when the task is running. 
   ```
   
   These are the canonical spellings.



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


[GitHub] [airflow] potiuk merged pull request #30040: Adding more information regarding top level code

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #30040:
URL: https://github.com/apache/airflow/pull/30040


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