Why doesn't self.log.info("Hello World") or print("Hello World") work in the __init__ method of my Custom Operator? #44649
Unanswered
sonjeongwons
asked this question in
Q&A
Replies: 1 comment
-
Because operator is created when DAG structure is created - and the others are run when the task is executed. This is basic assumpion - see also https://airflow.apache.org/docs/apache-airflow/stable/best-practices.html#top-level-python-code. The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After inheriting BaseOperator, we are creating a custom operator.
Why doesn't self.log.info("Hello World") or print("Hello World") work in the init method of my Custom Operator?
Those logging codes work in the pre_execute(), execute(), and post_execute() methods. However, they don't work in the init() method. Why is that?
Beta Was this translation helpful? Give feedback.
All reactions