Repository navigation
Restore TicketingHandler support for SQLAlchemy engines - #743
Merged
Merged
Conversation
Since 2e7f183 (2015) only URLs got the session that tickets were written with. Writing in engine.begin(), as the other methods do, needs no session.
Merging this PR will not alter performance1 warning
Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #743 +/- ##
==========================================
+ Coverage 91.40% 91.46% +0.06%
==========================================
Files 49 49
Lines 7931 7936 +5
Branches 609 609
==========================================
+ Hits 7249 7259 +10
+ Misses 546 542 -4
+ Partials 136 135 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
TicketingHandleraccepts an existing SQLAlchemyEnginein place of a database URL, but since Logbook 0.11.0 a supplied engine could not record tickets. With SQLAlchemy 2 the engine was not recognised and was passed tocreate_engine(); with SQLAlchemy 1.4 the backend never created the session it writes tickets with, so the first ticket failed.SQLAlchemyBackendnow recognisesEngineinstances and writes each ticket in anengine.begin()block, as its other methods already do, so it no longer needs a session; the undocumentedSQLAlchemyBackend.sessionattribute is removed. The ticketing documentation shows the engine form.