summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-04-11 14:23:29 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-04-11 14:23:29 -0400
commit17413bbf10c3b993d343c28035713a23c745712c (patch)
tree61c126a4101874d671288396c2dbf9432e3e86fc
parent53c65ed93ade1fc99c75e1f0bf055cd129596c06 (diff)
downloadsqlalchemy-17413bbf10c3b993d343c28035713a23c745712c.tar.gz
Black updates
Updating for a few black adjustments Change-Id: I9c8abadd1ccd6173e6d68dd62f14cec208cc304a
-rw-r--r--lib/sqlalchemy/__init__.py2
-rw-r--r--lib/sqlalchemy/dialects/postgresql/psycopg2.py2
-rw-r--r--lib/sqlalchemy/orm/util.py5
-rw-r--r--lib/sqlalchemy/sql/util.py4
-rw-r--r--test/dialect/mssql/test_compiler.py8
-rw-r--r--test/dialect/postgresql/test_dialect.py2
6 files changed, 9 insertions, 14 deletions
diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py
index 1e4292382..8782ad683 100644
--- a/lib/sqlalchemy/__init__.py
+++ b/lib/sqlalchemy/__init__.py
@@ -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):
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
index fb127f1c7..f7c5f668b 100644
--- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py
+++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
@@ -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):
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index 7b8edd349..36da781a4 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -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)
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index 8719b26ec..d90b3f158 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -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
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py
index 26e6d152c..339cc7590 100644
--- a/test/dialect/mssql/test_compiler.py
+++ b/test/dialect/mssql/test_compiler.py
@@ -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):
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index 1a735c41d..c68af2abb 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -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):