Skip to content

[v3-3-test] Route SQLAlchemyError through global exception handler (#69267) - #70236

Merged
pierrejeambrun merged 1 commit into
v3-3-testfrom
backport-7c03dab-v3-3-test
Jul 22, 2026
Merged

[v3-3-test] Route SQLAlchemyError through global exception handler (#69267)#70236
pierrejeambrun merged 1 commit into
v3-3-testfrom
backport-7c03dab-v3-3-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor
  • Route SQLAlchemyError through global exception handler

  • Replace manual traceback with logging

  • Update airflow-core/src/airflow/api_fastapi/common/exceptions.py

Co-authored-by: Jason(Zhe-You) Liu 68415893+jason810496@users.noreply.github.com

  • Add test for ti_run and include traceback when expose_stacktrace=True

  • Add test for ti_run and include traceback when expose_stacktrace=True

  • fix referenced before assignment problems

  • Handle execution API database errors consistently

  • Handle execution API database errors consistently

  • Refactor duplicated database error handling into helper

  • fix code format

  • Trigger CI rerun

  • Move database error response handling into handler class


(cherry picked from commit 7c03dab)

Co-authored-by: fat-catTW 124506982+fat-catTW@users.noreply.github.com
Co-authored-by: Jason(Zhe-You) Liu 68415893+jason810496@users.noreply.github.com

…69267)

* Route SQLAlchemyError through global exception handler

* Replace manual traceback with logging

* Update airflow-core/src/airflow/api_fastapi/common/exceptions.py

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>

* Add test for ti_run and include traceback when expose_stacktrace=True

* Add test for ti_run and include traceback when expose_stacktrace=True

* fix referenced before assignment problems

* Handle execution API database errors consistently

* Handle execution API database errors consistently

* Refactor duplicated database error handling into helper

* fix code format

* Trigger CI rerun

* Move database error response handling into handler class

---------
(cherry picked from commit 7c03dab)

Co-authored-by: fat-catTW <124506982+fat-catTW@users.noreply.github.com>
Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to backport this or should we tag as 3.4 milestone instead? I can't recall our convention on this kind of code level improvement should belong to minor or patch release.

@pierrejeambrun

Copy link
Copy Markdown
Member

Do we need to backport this or should we tag as 3.4 milestone instead? I can't recall our convention on this kind of code level improvement should belong to minor or patch release.

When it has no 'user impact' and it's a 'refactor' it's better to backport anyway to reduce the drift with 'main'. Otherwise the accumulation of such refactoring can bring a lot of conflicts in the future. And since v3-3-test branch is fresh, this will last for a while.

Also this can also fix cryptic error messages (SQLAlchemy exception) for parts of the code where it was not handled/unexpected, so it can only help to backport.

@pierrejeambrun
pierrejeambrun merged commit 9322e90 into v3-3-test Jul 22, 2026
101 checks passed
@pierrejeambrun
pierrejeambrun deleted the backport-7c03dab-v3-3-test branch July 22, 2026 14:33
@github-actions github-actions Bot added this to the Airflow 3.3.1 milestone Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.1 based on: merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

@vatsrahul1001 vatsrahul1001 added the type:misc/internal Changelog: Misc changes that should appear in change log label Jul 27, 2026
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
…69267) (#70236)

* Route SQLAlchemyError through global exception handler

* Replace manual traceback with logging

* Update airflow-core/src/airflow/api_fastapi/common/exceptions.py



* Add test for ti_run and include traceback when expose_stacktrace=True

* Add test for ti_run and include traceback when expose_stacktrace=True

* fix referenced before assignment problems

* Handle execution API database errors consistently

* Handle execution API database errors consistently

* Refactor duplicated database error handling into helper

* fix code format

* Trigger CI rerun

* Move database error response handling into handler class

---------
(cherry picked from commit 7c03dab)

Co-authored-by: fat-catTW <124506982+fat-catTW@users.noreply.github.com>
Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants