I have a simple python operator, defined like so:
loop_records = PythonOperator(
task_id = 'loop_records',
provide_context = True,
python_callable = loop_topic_records,
dag = dag
)
This python operator calls loop_topic_records, defined like so:
def loop_topic_records(**context):
parent_dag = context['dag']
for i in range(3):
op = DummyOperator(
task_id="child_" + str(i),
dag=parent_dag
)
logging.info('Child operator ' + str(i))
loop_records >> op
I see that the code does not raise any errors. It even prints Child operator 0..2 in the log. However, in the dag Graph view I do not see child operators, I just see only loop_records node, as if my dag consists only of one operator. So, what is wrong with that? And how can I fix it?