Skip to content

[v3-3-test] Remove redundant session.commit() calls in FastAPI route handlers#69620

Merged
vincbeck merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-69495
Jul 8, 2026
Merged

[v3-3-test] Remove redundant session.commit() calls in FastAPI route handlers#69620
vincbeck merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-69495

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Backport of #69495 to v3-3-test.

Cherry-picked from 5e23c6a.

Clean cherry-pick, no conflicts.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

…ache#69495)

The database session in the FastAPI layer is injected via the SessionDep dependency, which automatically commits the transaction when a request completes successfully. Explicitly calling session.commit() inside the route handler is redundant and circumvents the dependency's intended transaction lifecycle management. This brings the route handlers in line with the codebase guideline that prohibits functions accepting a session parameter from calling commit.

(cherry picked from commit 5e23c6a)
@vincbeck vincbeck merged commit 2864d96 into apache:v3-3-test Jul 8, 2026
71 checks passed
@github-actions github-actions Bot added this to the Airflow 3.3.1 milestone Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.1 based on: merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

vatsrahul1001 pushed a commit that referenced this pull request Jul 9, 2026
…9495) (#69620)

The database session in the FastAPI layer is injected via the SessionDep dependency, which automatically commits the transaction when a request completes successfully. Explicitly calling session.commit() inside the route handler is redundant and circumvents the dependency's intended transaction lifecycle management. This brings the route handlers in line with the codebase guideline that prohibits functions accepting a session parameter from calling commit.

(cherry picked from commit 5e23c6a)

Co-authored-by: Kushagra Gupta <kushagrab424@gmail.com>
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.

4 participants