Skip to content

Commit

Permalink
🎨 Clarify types / args
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Feb 6, 2025
1 parent 39caf89 commit e3d639c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions acapy_agent/askar/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ def session(
else:
return AskarProfileSession(self, is_txn=False, context=context)

def transaction(self, context: Optional[InjectionContext] = None) -> ProfileSession:
def transaction(
self, context: Optional[InjectionContext] = None
) -> "AskarProfileSession":
"""Start a new interactive session with commit and rollback support.
If the current backend does not support transactions, then commit
and rollback operations of the session will not have any effect.
"""
return AskarProfileSession(self, True, context=context)
return AskarProfileSession(self, is_txn=True, context=context)

async def close(self):
"""Close the profile instance."""
Expand Down
2 changes: 1 addition & 1 deletion acapy_agent/askar/profile_anon.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def transaction(
If the current backend does not support transactions, then commit
and rollback operations of the session will not have any effect.
"""
return AskarAnoncredsProfileSession(self, True, context=context)
return AskarAnoncredsProfileSession(self, is_txn=True, context=context)

async def close(self):
"""Close the profile instance."""
Expand Down

0 comments on commit e3d639c

Please sign in to comment.