Skip to content

Replace engine.connect() with engine.begin() in util.py#3799

Open
Phanindra899 wants to merge 1 commit intochaoss:mainfrom
Phanindra899:fix-engine-begin-util
Open

Replace engine.connect() with engine.begin() in util.py#3799
Phanindra899 wants to merge 1 commit intochaoss:mainfrom
Phanindra899:fix-engine-begin-util

Conversation

@Phanindra899
Copy link
Copy Markdown

This PR replaces engine.connect() with engine.begin() in augur/api/routes/util.py.

This aligns with SQLAlchemy 2.0 transaction handling, where engine.begin() ensures proper automatic commit/rollback behavior.

The change is limited to a read-only query context (get_all_repo_groups) and does not alter existing functionality.

@Phanindra899 Phanindra899 requested a review from sgoggins as a code owner March 27, 2026 12:11
Signed-off-by: Phanindra899 <p14410766@gmail.com>
@Phanindra899 Phanindra899 force-pushed the fix-engine-begin-util branch from 5447519 to 173444e Compare March 27, 2026 12:23
@MoralCode
Copy link
Copy Markdown
Contributor

Welcome! congrats on your first PR! This is a very small, targeted pr, so nice work!

I notice the line you changed is one that surrounds an query that only reads data from SQL. This particular case doesnt benefit from the autocommit distinction between connect() and begin()

Could you adjust this PR to apply the connect() -> begin() change to another query that is actually changing the data, such as an update or delete operation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants