Skip to content

[Ready for review, DO NOT MERGE] Render ephemeral dbt models as EmptyOperator by default#2759

Open
pankajkoti wants to merge 2 commits into
pankajkoti/boss-290-empty-operator-classfrom
pankajkoti/boss-290-feature-emptytask-for-ephemeral-materializations
Open

[Ready for review, DO NOT MERGE] Render ephemeral dbt models as EmptyOperator by default#2759
pankajkoti wants to merge 2 commits into
pankajkoti/boss-290-empty-operator-classfrom
pankajkoti/boss-290-feature-emptytask-for-ephemeral-materializations

Conversation

@pankajkoti
Copy link
Copy Markdown
Contributor

@pankajkoti pankajkoti commented Jun 2, 2026

Closes #1133.

Ephemeral dbt models are inlined as CTEs into downstream models and are never written to the warehouse, so running them through a dbt operator is a no-op that still spends worker time and issues warehouse metadata queries. Excluding them instead breaks the dependency chain for refs that pass through them.

Adds RenderConfig.ephemeral_models_as_empty_operator (default True): ephemeral models render as EmptyOperator tasks. The node stays in the graph, so the dependency chain passing through it is preserved, while the wasted dbt invocation is avoided and the DAG is decluttered. Set to False to keep rendering them as regular dbt run tasks.

Taking forward the work done in #1625

Stacked on #2758 — review and merge that first.

🤖 Generated with Claude Code

Add a centralized EMPTY_OPERATOR_CLASS constant that resolves to
airflow.providers.standard.operators.empty.EmptyOperator on Airflow 3 and
the legacy airflow.operators.empty.EmptyOperator on Airflow 2. Use it for
the source-without-freshness rendering path, which previously hardcoded the
legacy path and emitted a DeprecatedImportWarning on Airflow 3.
Ephemeral models are inlined as CTEs into downstream models and are never
written to the warehouse, so running them through a dbt operator is a no-op
that still spends worker time and issues warehouse metadata queries.

Add RenderConfig.ephemeral_models_as_empty_operator (default True) so that
ephemeral models render as EmptyOperator tasks. The node stays in the graph,
preserving the dependency chain that passes through it, while avoiding the
wasted dbt invocation and decluttering the DAG. Set it to False to keep
rendering ephemeral models as regular dbt run tasks.
@pankajkoti
Copy link
Copy Markdown
Contributor Author

The PR is ready for review. Please do not merge this PR. It relies on #2758 to be merged first.

@pankajkoti pankajkoti changed the title Render ephemeral dbt models as EmptyOperator by default [Ready for review, DO NOT MERGE] Render ephemeral dbt models as EmptyOperator by default Jun 3, 2026
@pankajkoti pankajkoti marked this pull request as ready for review June 3, 2026 15:32
@pankajkoti pankajkoti requested review from a team, corsettigyg, dwreeves and jbandoro as code owners June 3, 2026 15:32
@pankajkoti pankajkoti requested review from pankajastro and tatiana and removed request for a team June 3, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant