]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Black updates
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Apr 2019 18:23:29 +0000 (14:23 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Apr 2019 18:23:29 +0000 (14:23 -0400)
Updating for a few black adjustments

Change-Id: I9c8abadd1ccd6173e6d68dd62f14cec208cc304a

lib/sqlalchemy/__init__.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/util.py
test/dialect/mssql/test_compiler.py
test/dialect/postgresql/test_dialect.py

index 1e42923822e8908f8314d301a74c826525bd2436..8782ad683206f35a86e6c23193d41448ded12250 100644 (file)
@@ -122,7 +122,7 @@ from .engine import create_engine  # noqa nosort
 from .engine import engine_from_config  # noqa nosort
 
 
-__version__ = '1.3.3'
+__version__ = "1.3.3"
 
 
 def __go(lcls):
index fb127f1c75b43c87a01cc64e1a1e352fa0f63483..f7c5f668b4972ab362656263ea38ff7ac169e2fc 100644 (file)
@@ -776,7 +776,7 @@ class PGDialect_psycopg2(PGDialect):
         else:
             # no connection arguments whatsoever; psycopg2.connect()
             # requires that "dsn" be present as a blank string.
-            return ([''], opts)
+            return ([""], opts)
 
     def is_disconnect(self, e, connection, cursor):
         if isinstance(e, self.dbapi.Error):
index 7b8edd34933a4106d77b09ea605ca97037fe79d6..36da781a41a1400b4d6dbf2246a8ac6399b12626 100644 (file)
@@ -1265,10 +1265,7 @@ def _entity_corresponds_to_use_path_impl(given, entity):
         return (
             entity.is_aliased_class
             and not entity._use_mapper_path
-            and (
-                given is entity
-                or given in entity._with_polymorphic_entities
-            )
+            and (given is entity or given in entity._with_polymorphic_entities)
         )
     elif not entity.is_aliased_class:
         return given.common_parent(entity.mapper)
index 8719b26ec2e3a287fb599ecd0acd5491690bd768..d90b3f158bf562663a926e79bfa52de42130a420 100644 (file)
@@ -156,9 +156,7 @@ def find_left_clause_to_join_from(clauses, join_to, onclause):
         toremove = set(
             chain(*[_expand_cloned(f._hide_froms) for f in clauses])
         )
-        idx = [
-            i for i in idx if clauses[i] not in toremove
-        ]
+        idx = [i for i in idx if clauses[i] not in toremove]
 
     # onclause was given and none of them resolved, so assume
     # all indexes can match
index 26e6d152ccb192663557f078dd9c3e641895c556..339cc75907db0c4763c9cda3a406c96d52a4b5a5 100644 (file)
@@ -389,8 +389,8 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
 
         q = select(
-            [table1.c.myid, sql.literal('bar').label('c1')],
-            order_by=[table1.c.name + '-']
+            [table1.c.myid, sql.literal("bar").label("c1")],
+            order_by=[table1.c.name + "-"],
         ).alias("foo")
         crit = q.c.myid == table1.c.myid
         dialect = mssql.dialect()
@@ -402,9 +402,9 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
             "myid, ? AS c1 FROM mytable) AS foo, mytable WHERE "
             "foo.myid = mytable.myid",
             dialect=dialect,
-            checkparams={'param_1': 'bar'},
+            checkparams={"param_1": "bar"},
             # if name_1 is included, too many parameters are passed to dbapi
-            checkpositional=('bar', )
+            checkpositional=("bar",),
         )
 
     def test_force_schema_quoted_name_w_dot_case_insensitive(self):
index 1a735c41d37714ea12a3cf184ecf1f1cf978e8d0..c68af2abb89d441749877f10f983e43dfaaed5c5 100644 (file)
@@ -119,7 +119,7 @@ class DialectTest(fixtures.TestBase):
         dialect = psycopg2_dialect.dialect()
         u = url.make_url("postgresql://")
         cargs, cparams = dialect.create_connect_args(u)
-        eq_(cargs, [''])
+        eq_(cargs, [""])
         eq_(cparams, {})
 
     def test_psycopg2_nonempty_connection_string(self):