Factor out a shared base for the database error handlers#68512
Merged
pierrejeambrun merged 1 commit intoJun 15, 2026
Conversation
_UniqueConstraintErrorHandler and DataErrorHandler carried near-identical bodies — lookup id, statement log, [api] expose_stacktrace gating, and the HTTPException detail shape. Move the shared body into a _DatabaseErrorHandler base; each handler now declares only its status_code, reason, and an optional _should_handle guard. No behavior change.
jason810496
approved these changes
Jun 14, 2026
pgagnon
pushed a commit
to pgagnon/airflow
that referenced
this pull request
Jun 15, 2026
_UniqueConstraintErrorHandler and DataErrorHandler carried near-identical bodies — lookup id, statement log, [api] expose_stacktrace gating, and the HTTPException detail shape. Move the shared body into a _DatabaseErrorHandler base; each handler now declares only its status_code, reason, and an optional _should_handle guard. No behavior change.
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Jun 16, 2026
_UniqueConstraintErrorHandler and DataErrorHandler carried near-identical bodies — lookup id, statement log, [api] expose_stacktrace gating, and the HTTPException detail shape. Move the shared body into a _DatabaseErrorHandler base; each handler now declares only its status_code, reason, and an optional _should_handle guard. No behavior change.
dingo4dev
pushed a commit
to dingo4dev/airflow
that referenced
this pull request
Jun 16, 2026
_UniqueConstraintErrorHandler and DataErrorHandler carried near-identical bodies — lookup id, statement log, [api] expose_stacktrace gating, and the HTTPException detail shape. Move the shared body into a _DatabaseErrorHandler base; each handler now declares only its status_code, reason, and an optional _should_handle guard. No behavior change.
RulerChen
pushed a commit
to RulerChen/airflow
that referenced
this pull request
Jun 16, 2026
_UniqueConstraintErrorHandler and DataErrorHandler carried near-identical bodies — lookup id, statement log, [api] expose_stacktrace gating, and the HTTPException detail shape. Move the shared body into a _DatabaseErrorHandler base; each handler now declares only its status_code, reason, and an optional _should_handle guard. No behavior change.
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.
Cleanup requested in review on #66888:
_UniqueConstraintErrorHandlerandDataErrorHandlercarried near-identical bodies — the lookup id, statement log,[api] expose_stacktracegating, andHTTPExceptiondetail shape were copied between them.This moves that shared body into a
_DatabaseErrorHandlerbase, leaving each handler to declare only what differs: itsstatus_code, itsreason, and an optional_should_handleguard. The unique-constraint handler keeps its per-dialect match as that guard;DataErrorHandleralways handles.No behavior change — same statuses, payloads, and
expose_stacktracegating; the existingTestUniqueConstraintErrorHandler/TestDataErrorHandlersuites are untouched and pass.related: #66888