diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-28 14:08:59 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-28 15:17:26 -0400 |
commit | c3f102c9fe9811fd5286628cc6aafa5fbc324621 (patch) | |
tree | 4a78723089ded623701667de1eee21d22edbe6c1 /lib/sqlalchemy/ext/asyncio/engine.py | |
parent | 75ac0abc7d5653d10006769a881374a46b706db5 (diff) | |
download | sqlalchemy-c3f102c9fe9811fd5286628cc6aafa5fbc324621.tar.gz |
upgrade to black 20.8b1
It's better, the majority of these changes look more readable to me.
also found some docstrings that had formatting / quoting issues.
Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/engine.py')
-rw-r--r-- | lib/sqlalchemy/ext/asyncio/engine.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/engine.py b/lib/sqlalchemy/ext/asyncio/engine.py index 619cf8508..4a92fb1f2 100644 --- a/lib/sqlalchemy/ext/asyncio/engine.py +++ b/lib/sqlalchemy/ext/asyncio/engine.py @@ -85,16 +85,12 @@ class AsyncConnection(StartableContext): return self.sync_connection def begin(self) -> "AsyncTransaction": - """Begin a transaction prior to autobegin occurring. - - """ + """Begin a transaction prior to autobegin occurring.""" self._sync_connection() return AsyncTransaction(self) def begin_nested(self) -> "AsyncTransaction": - """Begin a nested transaction and return a transaction handle. - - """ + """Begin a nested transaction and return a transaction handle.""" self._sync_connection() return AsyncTransaction(self, nested=True) @@ -154,7 +150,10 @@ class AsyncConnection(StartableContext): conn = self._sync_connection() result = await greenlet_spawn( - conn.exec_driver_sql, statement, parameters, execution_options, + conn.exec_driver_sql, + statement, + parameters, + execution_options, ) if result.context._is_server_side: raise async_exc.AsyncMethodRequired( @@ -230,7 +229,10 @@ class AsyncConnection(StartableContext): conn = self._sync_connection() result = await greenlet_spawn( - conn._execute_20, statement, parameters, execution_options, + conn._execute_20, + statement, + parameters, + execution_options, ) if result.context._is_server_side: raise async_exc.AsyncMethodRequired( @@ -261,7 +263,7 @@ class AsyncConnection(StartableContext): return result.scalar() async def run_sync(self, fn: Callable, *arg, **kw) -> Any: - """"Invoke the given sync callable passing self as the first argument. + """Invoke the given sync callable passing self as the first argument. This method maintains the asyncio event loop all the way through to the database connection by running the given callable in a @@ -418,9 +420,7 @@ class AsyncTransaction(StartableContext): await greenlet_spawn(self._sync_transaction().close) async def rollback(self): - """Roll back this :class:`.Transaction`. - - """ + """Roll back this :class:`.Transaction`.""" await greenlet_spawn(self._sync_transaction().rollback) async def commit(self): |