Skip to content

Make select, exclude, selector, and models pseudo-parametrizable via skipping and trigger_rule="none_failed" #857

Open
@dwreeves

Description

Right now it is impossible to pass a Param() into a DbtDag() or DbtTaskGroup() that selects and de-selects models.

The reason why is pretty obvious when you think about it: these params are used to render the tasks in the DbtDag, and rendering does not have access to Jinja templating (only tasks while they are being executed have access).

That said, it could be possible to make accessible some sort of mechanism for raise AirflowSkipException when a task is excluded via a different mechanism than the DAG rendering. In combination with trigger_rule="none_failed", this could provide a mechanism for running subsets of tasks in a DAG via Params, while still having each dbt node correspond with a single Airflow operator.

(The other way to do this, which is by far the easiest way right now and will still have many advantages over this proposal, is to run every selected dbt task inside a single Airflow operator.)

Because of Airflow's internals, the selection of tasks in a DAG cannot be determined via Params, except via dynamic task mapping, which does not support task dependencies. However because skipping and trigger_rule="none_failed" achieves a similar behavior, this is why I refer to this as making the DbtDag "pseudo-parametrizable".

There are some real challenges here, this isn't as simple as just passing some args into the operators, but it's super-duper feasible and possible to imagine this existing as a feature.


Addendum + notes:

Metadata

Assignees

No one assigned

    Labels

    area:selectorRelated to selector, like DAG selector, DBT selector, etcdo-not-staleRelated to stale job and dosubotparsing:customRelated to custom parsing, like custom DAG parsing, custom DBT parsing, etc

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions