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 /examples | |
| 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 'examples')
| -rw-r--r-- | examples/asyncio/async_orm.py | 3 | ||||
| -rw-r--r-- | examples/asyncio/basic.py | 3 | ||||
| -rw-r--r-- | examples/asyncio/greenlet_orm.py | 3 | ||||
| -rw-r--r-- | examples/dogpile_caching/caching_query.py | 2 | ||||
| -rw-r--r-- | examples/versioned_rows/versioned_rows_w_versionid.py | 38 | ||||
| -rw-r--r-- | examples/vertical/dictlike-polymorphic.py | 5 |
6 files changed, 31 insertions, 23 deletions
diff --git a/examples/asyncio/async_orm.py b/examples/asyncio/async_orm.py index b1054a239..52df8bd2f 100644 --- a/examples/asyncio/async_orm.py +++ b/examples/asyncio/async_orm.py @@ -38,7 +38,8 @@ async def async_main(): """Main program function.""" engine = create_async_engine( - "postgresql+asyncpg://scott:tiger@localhost/test", echo=True, + "postgresql+asyncpg://scott:tiger@localhost/test", + echo=True, ) async with engine.begin() as conn: diff --git a/examples/asyncio/basic.py b/examples/asyncio/basic.py index 05cdd8a05..efdb7e9e8 100644 --- a/examples/asyncio/basic.py +++ b/examples/asyncio/basic.py @@ -27,7 +27,8 @@ t1 = Table( async def async_main(): # engine is an instance of AsyncEngine engine = create_async_engine( - "postgresql+asyncpg://scott:tiger@localhost/test", echo=True, + "postgresql+asyncpg://scott:tiger@localhost/test", + echo=True, ) # conn is an instance of AsyncConnection diff --git a/examples/asyncio/greenlet_orm.py b/examples/asyncio/greenlet_orm.py index e0b568c4b..7429b6853 100644 --- a/examples/asyncio/greenlet_orm.py +++ b/examples/asyncio/greenlet_orm.py @@ -64,7 +64,8 @@ async def async_main(): """Main program function.""" engine = create_async_engine( - "postgresql+asyncpg://scott:tiger@localhost/test", echo=True, + "postgresql+asyncpg://scott:tiger@localhost/test", + echo=True, ) async with engine.begin() as conn: await conn.run_sync(Base.metadata.drop_all) diff --git a/examples/dogpile_caching/caching_query.py b/examples/dogpile_caching/caching_query.py index f99447361..d1199090c 100644 --- a/examples/dogpile_caching/caching_query.py +++ b/examples/dogpile_caching/caching_query.py @@ -146,7 +146,7 @@ class FromCache(UserDefinedOption): class RelationshipCache(FromCache): """Specifies that a Query as called within a "lazy load" - should load results from a cache.""" + should load results from a cache.""" propagate_to_loaders = True diff --git a/examples/versioned_rows/versioned_rows_w_versionid.py b/examples/versioned_rows/versioned_rows_w_versionid.py index 7a1fe5419..790d2ed14 100644 --- a/examples/versioned_rows/versioned_rows_w_versionid.py +++ b/examples/versioned_rows/versioned_rows_w_versionid.py @@ -101,14 +101,17 @@ session.commit() e1.data = "e2" session.commit() -assert session.query( - Example.id, - Example.version_id, - Example.is_current_version, - Example.calc_is_current_version, - Example.data, -).order_by(Example.id, Example.version_id).all() == ( - [(1, 1, False, False, "e1"), (1, 2, True, True, "e2")] +assert ( + session.query( + Example.id, + Example.version_id, + Example.is_current_version, + Example.calc_is_current_version, + Example.data, + ) + .order_by(Example.id, Example.version_id) + .all() + == ([(1, 1, False, False, "e1"), (1, 2, True, True, "e2")]) ) # example 2, versioning with a parent @@ -159,12 +162,15 @@ session.commit() assert p1.child_id == 1 assert p1.child.version_id == 2 -assert session.query( - Child.id, - Child.version_id, - Child.is_current_version, - Child.calc_is_current_version, - Child.data, -).order_by(Child.id, Child.version_id).all() == ( - [(1, 1, False, False, "c1"), (1, 2, True, True, "c2")] +assert ( + session.query( + Child.id, + Child.version_id, + Child.is_current_version, + Child.calc_is_current_version, + Child.data, + ) + .order_by(Child.id, Child.version_id) + .all() + == ([(1, 1, False, False, "c1"), (1, 2, True, True, "c2")]) ) diff --git a/examples/vertical/dictlike-polymorphic.py b/examples/vertical/dictlike-polymorphic.py index 73d12ee4f..23a6e093d 100644 --- a/examples/vertical/dictlike-polymorphic.py +++ b/examples/vertical/dictlike-polymorphic.py @@ -67,9 +67,8 @@ class PolymorphicVerticalProperty(object): @value.comparator class value(PropComparator): - """A comparator for .value, builds a polymorphic comparison via CASE. - - """ + """A comparator for .value, builds a polymorphic comparison + via CASE.""" def __init__(self, cls): self.cls = cls |
