Skip to content

Add test to check profile metrics with non-cosmos operator#2215

Merged
pankajastro merged 3 commits into
mainfrom
add_missing_test_profile
Dec 19, 2025
Merged

Add test to check profile metrics with non-cosmos operator#2215
pankajastro merged 3 commits into
mainfrom
add_missing_test_profile

Conversation

@pankajastro
Copy link
Copy Markdown
Contributor

@pankajastro pankajastro commented Dec 19, 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

Copilot AI review requested due to automatic review settings December 19, 2025 06:25
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 19, 2025

Deploy Preview for astronomer-cosmos canceled.

Name Link
🔨 Latest commit 70bf932
🔍 Latest deploy log https://app.netlify.com/projects/astronomer-cosmos/deploys/6944f62fa874970008993c38

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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
  • Added necessary imports for type annotations and Airflow 3 compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/listeners/test_task_instance_listener.py Outdated
Comment thread tests/listeners/test_task_instance_listener.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.99%. Comparing base (fd3d647) to head (70bf932).
⚠️ Report is 2 commits behind head on main.

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.
📢 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.

@pankajastro pankajastro merged commit e5e5424 into main Dec 19, 2025
88 checks passed
@pankajastro pankajastro deleted the add_missing_test_profile branch December 19, 2025 10:37
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
@pankajkoti pankajkoti mentioned this pull request Dec 29, 2025
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>
@tatiana tatiana added this to the Cosmos 1.12.1 milestone Jan 29, 2026
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.

4 participants