Replace engine.connect() with engine.begin() in util.py#3799
Open
Phanindra899 wants to merge 1 commit intochaoss:mainfrom
Open
Replace engine.connect() with engine.begin() in util.py#3799Phanindra899 wants to merge 1 commit intochaoss:mainfrom
Phanindra899 wants to merge 1 commit intochaoss:mainfrom
Conversation
Signed-off-by: Phanindra899 <p14410766@gmail.com>
5447519 to
173444e
Compare
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.