[Ready for review, DO NOT MERGE] Render ephemeral dbt models as EmptyOperator by default#2759
Open
pankajkoti wants to merge 2 commits into
Conversation
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.
305b89b to
fe4c60d
Compare
Contributor
Author
|
The PR is ready for review. Please do not merge this PR. It relies on #2758 to be merged first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(defaultTrue): ephemeral models render asEmptyOperatortasks. 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 toFalseto keep rendering them as regular dbt run tasks.Taking forward the work done in #1625
🤖 Generated with Claude Code