Skip to content

Standardize response schemas for variables and xcoms in Execution API#63995

Open
rjgoyln wants to merge 2 commits intoapache:mainfrom
rjgoyln:api_response
Open

Standardize response schemas for variables and xcoms in Execution API#63995
rjgoyln wants to merge 2 commits intoapache:mainfrom
rjgoyln:api_response

Conversation

@rjgoyln
Copy link
Contributor

@rjgoyln rjgoyln commented Mar 20, 2026

Description

Currently, the Execution API has inconsistent response formats for success messages. While endpoints like connections.py return well-defined Pydantic schemas (e.g., ConnectionResponse), others like variables.py and xcoms.py return raw Python dictionaries (e.g., {"message": "..."}).

Returning raw dictionaries causes the OpenAPI specification to default to Any or object, which makes it difficult to generate strongly-typed SDKs and Clients.


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

@rjgoyln rjgoyln marked this pull request as ready for review March 20, 2026 15:55
Copy link
Contributor

@SameerMesiah97 SameerMesiah97 left a comment

Choose a reason for hiding this comment

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

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(
):
Copy link
Contributor

Choose a reason for hiding this comment

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

You might need to specify a return type here like this to satisfy MyPy:

-> MessageResponse



@router.delete(
"/{variable_key:path}",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would explicitly set the status code here like this:

status_code=status.HTTP_200_OK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks your advise!!

@potiuk potiuk marked this pull request as draft March 22, 2026 11:36
@potiuk
Copy link
Member

potiuk commented Mar 22, 2026

@rjgoyln This PR has been converted to draft because it does not yet meet our Pull Request quality criteria.

Issues found:

  • Merge conflicts: This PR has merge conflicts with the main branch. Your branch is 92 commits behind main. Please rebase your branch (git fetch origin && git rebase origin/main), resolve the conflicts, and push again. See contributing quick start.

Note: Your branch is 92 commits behind main. Some check failures may be caused by changes in the base branch rather than by your PR. Please rebase your branch and push again to get up-to-date CI results.

What to do next:

  • The comment informs you what you need to do.
  • Fix each issue, then mark the PR as "Ready for review" in the GitHub UI - but only after making sure that all the issues are fixed.
  • There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates.
  • Maintainers will then proceed with a normal review.

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.

@rjgoyln rjgoyln marked this pull request as ready for review March 22, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants