Skip to content
Advertisement

Symfony errors not returned through Airflow

So here is my problem: airflow, Since executes a Python file that calls a php script (Symfony) to perform a created command. The command itself works fine. The execution of the latter from Airflow also works very well (with the visual display of Airflow: runs success).

When I cause an error in the symfony command (exit(1), throw,…), to see how Airflow reacts, it always shows success. How do I make him understand that the script didn’t work?

Here is the python code:

JavaScript

And the route for the Symfony command:

JavaScript

Thanking you for your return.

Advertisement

Answer

The SimpleHttpOperator allows you to run a check against the requests response object. If the check returns false an AirflowException would be raise and the operator will fail.

Example:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement