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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]