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 | |
| 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')
| -rw-r--r-- | lib/sqlalchemy/ext/associationproxy.py | 3 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/asyncio/engine.py | 24 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/asyncio/result.py | 5 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/asyncio/session.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/baked.py | 3 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/hybrid.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/orderinglist.py | 2 |
7 files changed, 18 insertions, 25 deletions
diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index 3ea77a952..a2c6b596f 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -840,8 +840,7 @@ class AmbiguousAssociationProxyInstance(AssociationProxyInstance): class ObjectAssociationProxyInstance(AssociationProxyInstance): - """an :class:`.AssociationProxyInstance` that has an object as a target. - """ + """an :class:`.AssociationProxyInstance` that has an object as a target.""" _target_is_object = True _is_canonical = True 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): diff --git a/lib/sqlalchemy/ext/asyncio/result.py b/lib/sqlalchemy/ext/asyncio/result.py index 52b40acba..7f8a707d5 100644 --- a/lib/sqlalchemy/ext/asyncio/result.py +++ b/lib/sqlalchemy/ext/asyncio/result.py @@ -553,10 +553,7 @@ class AsyncMappingResult(FilterResult): def columns(self, *col_expressions): # type: (*object) -> AsyncMappingResult - r"""Establish the columns that should be returned in each row. - - - """ + r"""Establish the columns that should be returned in each row.""" return self._column_slices(col_expressions) async def partitions(self, size=None): diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py index 167301780..cb06aa26d 100644 --- a/lib/sqlalchemy/ext/asyncio/session.py +++ b/lib/sqlalchemy/ext/asyncio/session.py @@ -269,9 +269,7 @@ class AsyncSessionTransaction(StartableContext): return self.sync_transaction async def rollback(self): - """Roll back this :class:`_asyncio.AsyncTransaction`. - - """ + """Roll back this :class:`_asyncio.AsyncTransaction`.""" await greenlet_spawn(self._sync_transaction().rollback) async def commit(self): diff --git a/lib/sqlalchemy/ext/baked.py b/lib/sqlalchemy/ext/baked.py index 288677387..8a2023e96 100644 --- a/lib/sqlalchemy/ext/baked.py +++ b/lib/sqlalchemy/ext/baked.py @@ -173,8 +173,7 @@ class BakedQuery(object): return self._cache_key + (session._query_cls,) def _with_lazyload_options(self, options, effective_path, cache_path=None): - """Cloning version of _add_lazyload_options. - """ + """Cloning version of _add_lazyload_options.""" q = self._clone() q._add_lazyload_options(options, effective_path, cache_path=cache_path) return q diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index 75bb028f0..83562502a 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -950,7 +950,7 @@ class hybrid_property(interfaces.InspectionAttrInfo): :ref:`hybrid_reuse_subclass` - """ + """ return self def getter(self, fget): diff --git a/lib/sqlalchemy/ext/orderinglist.py b/lib/sqlalchemy/ext/orderinglist.py index 7b6b77997..03ea096e7 100644 --- a/lib/sqlalchemy/ext/orderinglist.py +++ b/lib/sqlalchemy/ext/orderinglist.py @@ -376,7 +376,7 @@ class OrderingList(list): def _reconstitute(cls, dict_, items): - """ Reconstitute an :class:`.OrderingList`. + """Reconstitute an :class:`.OrderingList`. This is the adjoint to :meth:`.OrderingList.__reduce__`. It is used for unpickling :class:`.OrderingList` objects. |
