Skip to content

Remove explicit session.commit() from delete_xcom to align with request-scoped session handling#65440

Open
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:xcom-delete-remove-explicit-commit
Open

Remove explicit session.commit() from delete_xcom to align with request-scoped session handling#65440
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:xcom-delete-remove-explicit-commit

Conversation

@jmestwa-coder
Copy link
Copy Markdown

Summary

Remove the explicit session.commit() call from delete_xcom to align with the request-scoped session handling pattern used across other API endpoints.


Details

  • The delete_xcom route previously called session.commit() directly after executing the delete query.
  • Other API handlers in the same module rely on the session lifecycle managed by FastAPI dependencies and do not perform explicit commits.
  • This change removes the explicit commit to keep behavior consistent across endpoints and avoid premature transaction finalization within the handler.

Why this change

  • Ensures consistent session handling across all execution API routes
  • Avoids committing within the handler when session lifecycle is externally managed
  • Keeps the endpoint behavior aligned with existing patterns in the codebase

Impact

  • No change to API interface or response format
  • No change to query logic or execution flow
  • Transaction handling remains managed by the surrounding request lifecycle

Testing

  • Existing tests continue to pass
  • No additional tests introduced, as this change aligns behavior with existing endpoints rather than introducing new functionality

Notes

  • This change is intentionally minimal and scoped to a single line removal
  • Follows existing patterns in the same file for session usage

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

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 17, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@jmestwa-coder jmestwa-coder force-pushed the xcom-delete-remove-explicit-commit branch 2 times, most recently from 34bcb03 to 3c9f446 Compare April 21, 2026 18:53
@potiuk potiuk added ready for maintainer review Set after triaging when all criteria pass. and removed ready for maintainer review Set after triaging when all criteria pass. labels Apr 22, 2026
@jmestwa-coder jmestwa-coder force-pushed the xcom-delete-remove-explicit-commit branch 2 times, most recently from 52752a5 to fc5d46b Compare May 3, 2026 14:05
@jmestwa-coder jmestwa-coder force-pushed the xcom-delete-remove-explicit-commit branch 3 times, most recently from c43895e to 526d6a9 Compare May 7, 2026 19:20
@jmestwa-coder
Copy link
Copy Markdown
Author

jmestwa-coder commented May 7, 2026

hi @amoghrajesh Can you kindly review this PR. Thank you!

@jmestwa-coder jmestwa-coder force-pushed the xcom-delete-remove-explicit-commit branch 2 times, most recently from e52f454 to d20d1f5 Compare May 12, 2026 14:52
@jmestwa-coder jmestwa-coder force-pushed the xcom-delete-remove-explicit-commit branch from d20d1f5 to 14f1a3f Compare May 15, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants