Skip to content

Replaced manual response descriptions with create_openapi_http_exception_doc - #62624

Merged
jason810496 merged 1 commit into
apache:mainfrom
henry3260:use-create-openapi-http-exception-doc
May 27, 2026
Merged

jason810496 merged 1 commit into
apache:mainfrom
henry3260:use-create-openapi-http-exception-doc

Conversation

@henry3260

@henry3260 henry3260 commented Feb 28, 2026 •

Copy link
Copy Markdown
Member

Why

Currently, some endpoints in the execution_api for TaskInstances (such as run and rtif) define their HTTP error responses (404, 409, 422) manually using hardcoded dictionaries.

What

Refactored responses definitions: Replaced manual dictionaries in the @ti_id_router.patch (for run endpoint) and @router.put (for rtif endpoint) with the create_openapi_http_exception_doc helper.

closes: #60467

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@henry3260 henry3260 changed the title Replaced manual response descriptions with create_openapi_http_except… Replaced manual response descriptions with create_openapi_http_exception_doc Feb 28, 2026

@SameerMesiah97 SameerMesiah97 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks fine but is it possible for the descriptions to be added back? It is important context.

@henry3260

Copy link
Copy Markdown
Member Author

cc @jason810496, Can I get your review when you get a chance? Thanks in advance!

@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Apr 2, 2026

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

I think it's possible to keep the description while standardize the error for FastAPI route.

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

Thanks, LGTM after resolving the conflict.

Additionally, could you share the screenshot of the OpenAPI page of Execution API to make sure the existing "description" fields remain unchanged? Thanks.

@henry3260
henry3260 force-pushed the use-create-openapi-http-exception-doc branch 7 times, most recently from bf48755 to 2bdb150 Compare May 11, 2026 15:59
@henry3260

Copy link
Copy Markdown
Member Author

Thanks, LGTM after resolving the conflict.

Additionally, could you share the screenshot of the OpenAPI page of Execution API to make sure the existing "description" fields remain unchanged? Thanks.

Sure!
PATCH /task-instances/{task_instance_id}/run
image
PUT /task-instances/{task_instance_id}/heartbeat
image

@henry3260
henry3260 force-pushed the use-create-openapi-http-exception-doc branch from 2bdb150 to bbab062 Compare May 11, 2026 19:38

@pierrejeambrun pierrejeambrun 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.

Nice, this is a clean follow-up to the helper extension @jason810496 suggested. Two things to flag before merge though: a few endpoint descriptions seem to have been silently rewritten rather than preserved (which was the whole point per the earlier feedback), and the trailing-period style is inconsistent. Details inline.


Drafted-by: Claude Code (Opus 4.7); reviewed by @pierrejeambrun before posting

@henry3260
henry3260 force-pushed the use-create-openapi-http-exception-doc branch from bbab062 to 82840a0 Compare May 21, 2026 13:20

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

Nice!

@potiuk potiuk removed the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label May 24, 2026
@potiuk

potiuk commented May 26, 2026

Copy link
Copy Markdown
Member

@henry3260 A few things need addressing before review — see our Pull Request quality criteria.

  • ❌ Provider tests. See docs.

No rush.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.


Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting

@henry3260
henry3260 force-pushed the use-create-openapi-http-exception-doc branch 2 times, most recently from 2066e1c to 412a1de Compare May 27, 2026 08:51
…ion_doc for Task Instance routes. This ensures consistent OpenAPI documentation across the Execution API and removes redundant hardcoded strings.
@henry3260
henry3260 force-pushed the use-create-openapi-http-exception-doc branch from 412a1de to b7ec55d Compare May 27, 2026 10:05
@henry3260

Copy link
Copy Markdown
Member Author

CI is green now!

@henry3260
henry3260 requested a review from pierrejeambrun May 27, 2026 12:01
@jason810496 jason810496 added the area:API Airflow's REST/HTTP API label May 27, 2026
@jason810496
jason810496 merged commit 6be0310 into apache:main May 27, 2026
143 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider create_openapi_http_exception_doc for RTIF endpoint

5 participants