Skip to content

Render ephemeral type DBT model & no freshness DBT source with test as EmptyOperator #1625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

okayhooni
Copy link

@okayhooni okayhooni commented Mar 18, 2025

Description

  • dbt models with ephemeral materialization type that serve only as CTEs should not be rendered as DbtRunOperator tasks, as they unnecessarily occupy Airflow worker slots, even for a short period.
  • Updated the logic to render these ephemeral models as EmptyOperator tasks instead, ensuring they are processed quickly by the Airflow scheduler without being assigned to an Airflow worker.
  • Similarly, DBT source nodes without a freshness check but with downstream tests are rendered as EmptyOperator to avoid unnecessary worker slot resource consumption.

Breaking Change?

No

Checklist

  • I have made corresponding changes to the documentation (if required)
  • I have added tests that prove my fix is effective or that my feature works

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 18, 2025
@dosubot dosubot bot added the area:rendering Related to rendering, like Jinja, Airflow tasks, etc label Mar 18, 2025
Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for sunny-pastelito-5ecb04 canceled.

Name Link
🔨 Latest commit 32b15b9
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/67dab105e5ffc20008e00547

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.41%. Comparing base (43b5400) to head (32b15b9).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
cosmos/airflow/graph.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1625      +/-   ##
==========================================
- Coverage   97.43%   97.41%   -0.02%     
==========================================
  Files          80       80              
  Lines        4950     4957       +7     
==========================================
+ Hits         4823     4829       +6     
- Misses        127      128       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@okayhooni okayhooni changed the title Render ephemeral type DBT model as EmptyOperator Render ephemeral type DBT model & no freshness DBT source with test as EmptyOperator Mar 19, 2025
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Apr 19, 2025
@github-actions github-actions bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rendering Related to rendering, like Jinja, Airflow tasks, etc size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants