Skip to content

Pass in parameters via the Airflow CLI Test command #1148

@r39132

Description

@r39132

I use the Airflow CLI heavily. Currently, my python automation uses the test command in order to execute tasks. I would like to pass parameters as JSON dicts via airflow test my_dag my_first_task <date>. For example, via airflow test my_dag my_first_task <date> -tp '{"foo":"bar"}', so that my Airflow task can access it!

To give a real-world example, we currently run airflow DAG to load data for all of our customer organizations. However, we use the CLI to reload particular orgs - we need a means to pass a list of organization_ids to the task from our reload_data.py script, a script that calls airflow via the CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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