fjmacagno commented on code in PR #32811:
URL: https://github.com/apache/airflow/pull/32811#discussion_r1275280566
##########
docs/apache-airflow/howto/usage-cli.rst:
##########
@@ -374,3 +374,31 @@ JSON example output:
airflow_db={"conn_type": "mysql", "login": "root", "password":
"plainpassword", "host": "mysql", "schema": "airflow"}
druid_broker_default={"conn_type": "druid", "host": "druid-broker",
"port": 8082, "extra": "{\"endpoint\": \"druid/v2/sql\"}"}
+
+Testing for DAG Import Errors
+-----------------------------
+The CLI can be used to check whether any discovered DAGs have import errors
via the `dags` `list-import-errors` command. The output is predictable for
situations where there are no errors, such as `[]` for the json style output,
so it is possible to create an automation step which fails if any DAGs cannot
be imported. For instance, the check could be run in CI or pre-commit.
+
+Example command that fails if there are any errors:
+
+.. code-block:: bash
+
+ airflow dags list-import-errors | grep -q "No data found"
Review Comment:
That was actually my original approach, but i moved to this one so that i
wasn't adding a new dependency. Would it make sense to add a second example
using jq?
--
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]