Skip to content

Add output format to missing cli commands #29178

Description

@manugarri

Description

I have noticed that for some commands, there is an option to get the output in json or yaml (as described in this PR from 2020 #12699).

However, there are still some commands that do not support the --output argument, most notable one is the dags trigger.

When triggering a dag, it is crucial to get the run_id that has been triggered, so the triggered dag run can be monitored by the calling party. However, the output from this command is hard to parse without resorting to (gasp!) regex:

[2023-01-26 11:03:41,038] {{__init__.py:42}} INFO - Loaded API auth backend: airflow.api.auth.backend.session
Created <DagRun sample_dag @ 2023-01-26T11:03:41+00:00: manual__2023-01-26T11:03:41+00:00, state:queued, queued_at: 2023-01-26 11:03:41.412394+00:00. externally triggered: True>

As you can see, extracting the run_id manual__2023-01-26T11:03:41+00:00 is not easy from the above output.

For what I see in the code, the ARG_OUTPUT is not added to dag_trigger command.

Use case/motivation

At my company we want to be able to trigger dags from another airflow environment (mwaa) and be able to wait for its completion before proceeding with the calling DAG.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions