I am using a PythonOperator in my Airflow DAG and I need to print something inside the operator's Python function. I tried to print but apparently it didn't work out. Not so sure that's going to work. Next I tried to pass self.log in PythonOperator but I am not sure how to pass that reference.
task = PythonOperator(
task_id='task1',
python_callable=my_func,
params={ ... },
provide_context=True,
dag=dag
)
...
def my_func(**context):
...
print(some_message) # this didn't work.