Standardize response schemas for variables and xcoms in Execution API#63995
Standardize response schemas for variables and xcoms in Execution API#63995rjgoyln wants to merge 2 commits intoapache:mainfrom
Conversation
SameerMesiah97
left a comment
There was a problem hiding this comment.
Looks fine. I have left a few comments.
One thing, I’m a bit surprised tests haven’t been adjusted for this. Since this changes the response model and DELETE status from 204 to 200, I would have expected some assertions around return values and/or status codes to be updated. Have you run the relevant unit tests locally?
| @@ -96,12 +97,11 @@ def put_variable( | |||
| ): | |||
There was a problem hiding this comment.
You might need to specify a return type here like this to satisfy MyPy:
-> MessageResponse
|
|
||
|
|
||
| @router.delete( | ||
| "/{variable_key:path}", |
There was a problem hiding this comment.
I would explicitly set the status code here like this:
status_code=status.HTTP_200_OK
There was a problem hiding this comment.
Thanks your advise!!
|
@rjgoyln This PR has been converted to draft because it does not yet meet our Pull Request quality criteria. Issues found:
What to do next:
Converting a PR to draft is not a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack. |
Description
Currently, the Execution API has inconsistent response formats for success messages. While endpoints like
connections.pyreturn well-defined Pydantic schemas (e.g.,ConnectionResponse), others likevariables.pyandxcoms.pyreturn raw Python dictionaries (e.g.,{"message": "..."}).Returning raw dictionaries causes the OpenAPI specification to default to
Anyorobject, which makes it difficult to generate strongly-typed SDKs and Clients.Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.