Add test to check profile metrics with non-cosmos operator#2215
Merged
Conversation
✅ Deploy Preview for astronomer-cosmos canceled.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a test to verify that profile metrics are correctly handled when dealing with non-Cosmos operators. The test ensures that when _build_task_metrics is called on a task instance with a regular Airflow operator (not a dbt/Cosmos operator), the profile-related metrics return appropriate None values.
Key changes:
- Added a
DummyOperatorclass that extendsBaseOperatorwithout Cosmos-specific functionality - Added
test_profile_metrics_with_non_cosmos_operator()to validate metrics behavior with non-Cosmos operators - Added necessary imports for type annotations and Airflow 3 compatibility
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pankajkoti
approved these changes
Dec 19, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2215 +/- ##
==========================================
+ Coverage 97.97% 97.99% +0.01%
==========================================
Files 95 95
Lines 6187 6187
==========================================
+ Hits 6062 6063 +1
+ Misses 125 124 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pankajkoti
pushed a commit
that referenced
this pull request
Dec 29, 2025
Address: #2198 (review) This pull request adds a test to verify that profile metrics are correctly handled when dealing with non-Cosmos operators. The test ensures that when `_build_task_metrics` is called on a task instance with a regular Airflow operator (not a dbt/Cosmos operator), the profile-related metrics return appropriate `None` values. **Key changes:** - Added a `DummyOperator` class that extends `BaseOperator` without Cosmos-specific functionality - Added `test_profile_metrics_with_non_cosmos_operator()` to validate metrics behavior with non-Cosmos operators
Merged
tatiana
added a commit
that referenced
this pull request
Jan 14, 2026
Bug Fixes * Fix ``DbtSourceWatcherOperator.template_fields`` to inherit from ``DbtSourceLocalOperator`` instead of ``DbtConsumerWatcherSensor`` by @pankajkoti in #2226 * Fix TypeError in Watcher mode with subprocess invocation by @pankajkoti in #2227 * Error when RenderConfig.invocation_mode is incorrectly set by @tatiana in #2267 Docs * Fix minor documentation typo by @dnskr in #2093 * Fix default values in documentation by @dnskr in #2092 * Remove emit event for ExecutionMode.AIRFLOW_ASYNC limitation in docs by @pankajastro in #2214 Others * Add test to check profile metrics with non-Cosmos operator by @pankajastro in #2215 * Fix CI main branch Airflow 2.6 tests by @tatiana in #2268 closes: astronomer/oss-integrations-private#295 Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
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.
Address: #2198 (review)
This pull request adds a test to verify that profile metrics are correctly handled when dealing with non-Cosmos operators. The test ensures that when
_build_task_metricsis called on a task instance with a regular Airflow operator (not a dbt/Cosmos operator), the profile-related metrics return appropriateNonevalues.Key changes:
DummyOperatorclass that extendsBaseOperatorwithout Cosmos-specific functionalitytest_profile_metrics_with_non_cosmos_operator()to validate metrics behavior with non-Cosmos operators