dgbarmac commented on issue #26760:
URL: https://github.com/apache/airflow/issues/26760#issuecomment-1626037839
Hi,
I think I have a related problem. I'm using Airflow v2.5.1 and testing using
the following code:
```
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
from utils import UtilsFunctions
default_args = {
'owner': 'owner',
'email_on_failure': False,
'email_on_retry': False,
'email': ['[email protected]'],
}
def failure_callback_dag(context):
print("Inside failure_callback_dag")
print(context["task_instance"])
print(context["task"])
with DAG(
dag_id='sns_test',
default_args=default_args,
start_date=datetime(2023, 1, 1),
schedule_interval=None,
on_success_callback=None,
on_failure_callback=failure_callback_dag,
catchup=False,
) as dag:
task = BashOperator(
task_id="bash-error",
bash_command=f"error",
)
task
```
Checking the logs I can't see the prints that I made. I think that the
callback is not even being called. Using the default_args works but I would
like to have a callback called only once.
I can't see what I am doing wrong.
Do you have any ideias?
--
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]