Skip to content

Handle Param Validation errors#2358

Merged
tatiana merged 8 commits into
mainfrom
param-validation-error-handling
Feb 13, 2026
Merged

Handle Param Validation errors#2358
tatiana merged 8 commits into
mainfrom
param-validation-error-handling

Conversation

@tatiana
Copy link
Copy Markdown
Collaborator

@tatiana tatiana commented Feb 13, 2026

While trying to run some DAGs locally with Airflow 3.1.7, I observed this behaviour intermitently:
Screenshot 2026-02-13 at 09 45 06

Although I was unable to create a reproducible sequence of steps to reproduce it, I believe we should handle this exception so it is not disruptive to end users.

Copilot AI review requested due to automatic review settings February 13, 2026 10:40
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 13, 2026

Deploy Preview for astronomer-cosmos canceled.

Name Link
🔨 Latest commit 1326ec7
🔍 Latest deploy log https://app.netlify.com/projects/astronomer-cosmos/deploys/698f22554d1d880008ae65d1

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 PR hardens Cosmos DAG conversion by handling Airflow param validation failures when persisting compressed telemetry metadata into dag.params, so DAG parsing/conversion can continue even if the param write is rejected.

Changes:

  • Import ParamValidationError from Airflow exceptions.
  • Wrap storing __cosmos_telemetry_metadata__ in dag.params with a try/except ParamValidationError and emit a warning on failure.

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

Comment thread cosmos/converter.py Outdated
Comment thread cosmos/converter.py Outdated
Copy link
Copy Markdown
Contributor

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

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

LGTM, CI might complain about missing patch coverage, so it could be good add a unit test to cover the exception handling.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.90%. Comparing base (02545bd) to head (6b2652e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2358   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files         102      102           
  Lines        6833     6840    +7     
=======================================
+ Hits         6690     6697    +7     
  Misses        143      143           

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

tatiana and others added 5 commits February 13, 2026 12:08
Attempt to fix the issue that PRs are not having automatic reviewers.

In practice, @astronomer/astro-cosmos-admins exists only for
organisational reasons, and the people in that group have not been
contributing to the project - except me (but I'm part of
@astronomer/oss-integrations)
Co-authored-by: Phani Kumar <phani.kumar@astronomer.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 13, 2026 12:09
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


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

Comment thread tests/test_converter.py
Comment thread pyproject.toml
Comment thread CODEOWNERS
Comment thread README.rst
@tatiana tatiana merged commit a6c7dd7 into main Feb 13, 2026
72 of 73 checks passed
@tatiana tatiana deleted the param-validation-error-handling branch February 13, 2026 13:08
@tatiana tatiana added this to the Cosmos 1.14.0 milestone Feb 19, 2026
@tatiana tatiana modified the milestones: Cosmos 1.14.0, Cosmos 1.13.1 Feb 20, 2026
tatiana added a commit that referenced this pull request Feb 20, 2026
While trying to run some DAGs locally with Airflow 3.1.7, I observed
this behaviour intermitently:
<img width="825" height="755" alt="Screenshot 2026-02-13 at 09 45 06"
src="https://github.com/user-attachments/assets/b5305a77-e07b-4dcd-84d3-9668f300013c"
/>

Although I was unable to create a reproducible sequence of steps to
reproduce it, I believe we should handle this exception so it is not
disruptive to end users.
@tatiana tatiana mentioned this pull request Feb 20, 2026
tatiana added a commit that referenced this pull request Feb 25, 2026
**Enhancements**

* Change Snowflake profile mappings to default to four threads by
@tatiana in #2374
* Refactor to avoid potential future ``UnboundLocalError`` for
``producer_task`` in ``calculate_tasks_map`` by @rin in #2309

**Bug Fixes**

* Fix graph selector when using + selector with ``dbt-loom`` by
@award1230 in #2389
* Populate ``compiled_sql`` for ``InvocationMode.SUBPROCESS`` in
``ExecutionMode.WATCHER`` by @pankajkoti in #2319
* Preserve ``extra_context`` for watcher consumer task instances by
@pankajkoti in #2381
* Fix watcher: respect ``deferrable=False`` from ``operator_args`` on
consumer sensor by @pankajkoti in #2384
* Error handle invalid YAML with ``LoadMode.DBT_MANIFEST`` and
``RenderConfig.selector`` by @jonbillings in #2316
* Fix selecting model when it has the same name as folder by
@pankajastro in #2328
* Handle Param Validation errors by @tatiana in #2358
* Fix cache swap issue by @jonbillings in #2332
* Fix leaked semaphore warnings in Airflow 3 by resetting dbt adapters
by @pankajkoti in #2335

**Docs**

* Document ``ExecutionMode.KUBERNETES`` limitations by @tatiana in #2326

**Others**

* Add .airflow-registry.yaml for Airflow Provider Registry by @kaxil in
#2387
* Improve test coverage for PR #2307 by @tatiana in #2308
* Address feedback from code review #2389 by @evanvolgas in #2394

Closes:
astronomer/oss-integrations-private#333
@tatiana tatiana mentioned this pull request Feb 25, 2026
tatiana added a commit that referenced this pull request Feb 25, 2026
Enhancements

* Change Snowflake profile mappings to default to four threads by
@tatiana in #2374
* Refactor to avoid potential future ``UnboundLocalError`` for
``producer_task`` in ``calculate_tasks_map`` by @rin in #2309

Bug Fixes

* Fix graph selector when using + selector with ``dbt-loom`` by
@award1230 in #2389
* Populate ``compiled_sql`` for ``InvocationMode.SUBPROCESS`` in
``ExecutionMode.WATCHER`` by @pankajkoti in #2319
* Preserve ``extra_context`` for watcher consumer task instances by
@pankajkoti in #2381
* Fix watcher: respect ``deferrable=False`` from ``operator_args`` on
consumer sensor by @pankajkoti in #2384
* Error handle invalid YAML with ``LoadMode.DBT_MANIFEST`` and
``RenderConfig.selector`` by @YourRoyalLinus in #2316
* Fix selecting model when it has the same name as folder by
@pankajastro in #2328
* Handle Param Validation errors by @tatiana in #2358
* Fix cache swap issue by @YourRoyalLinus in #2332
* Fix leaked semaphore warnings in Airflow 3 by resetting dbt adapters
by @pankajkoti in #2335

Docs

* Document ``ExecutionMode.KUBERNETES`` limitations by @tatiana in #2326

Others

* Add .airflow-registry.yaml for Airflow Provider Registry by @kaxil in
#2387
* Improve test coverage for PR #2307 by @tatiana in #2308
* Address feedback from code review #2389 by @evanvolgas in #2394

Additional details on this change:
- The actual release was done from branch 1.13:
https://github.com/astronomer/astronomer-cosmos/releases/tag/astronomer-cosmos-v1.13.1
- This PR aims to update our CHANGELOG, and allow us to give credit to
the username that was being questioned by codespell
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.

3 participants