wolfier commented on a change in pull request #15183:
URL: https://github.com/apache/airflow/pull/15183#discussion_r609136866
##########
File path: docs/apache-airflow/best-practices.rst
##########
@@ -54,6 +59,12 @@ Some of the ways you can avoid producing a different result -
You should define repetitive parameters such as ``connection_id`` or S3
paths in ``default_args`` rather than declaring them for each task.
The ``default_args`` help to avoid mistakes such as typographical errors.
+Creating a custom Operator
+---------------------------
+
+When implementing custom operators, do not make any expensive expensive
operations in their ``__init__``. They are
+going to be instantiated once per scheduler run per task using them, and
making database calls can significantly slow
+down scheduling and waste resources.
Review comment:
Got it!
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]