summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2022-01-05 12:41:32 -0500
committersqla-tester <sqla-tester@sqlalchemy.org>2022-01-05 12:41:32 -0500
commit146a349d81023805264f81643db50a5281da90da (patch)
tree8c0b6e56e3f29b8187de1b8a9af21af4cebbd6a2 /lib/sqlalchemy
parent028f9b5cacc1b70aa0f4f53799f6e7c14a182776 (diff)
downloadsqlalchemy-146a349d81023805264f81643db50a5281da90da.tar.gz
Update Black's target-version to py37
<!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> Black's `target-version` was still set to `['py27', 'py36']`. Set it to `[py37]` instead. Also update Black and other pre-commit hooks and re-format with Black. ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #7536 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7536 Pull-request-sha: b3aedf5570d7e0ba6c354e5989835260d0591b08 Change-Id: I8be85636fd2c9449b07a8626050c8bd35bd119d5
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py8
-rw-r--r--lib/sqlalchemy/dialects/mysql/base.py2
-rw-r--r--lib/sqlalchemy/dialects/mysql/types.py2
-rw-r--r--lib/sqlalchemy/dialects/oracle/base.py10
-rw-r--r--lib/sqlalchemy/dialects/oracle/cx_oracle.py6
-rw-r--r--lib/sqlalchemy/dialects/postgresql/_psycopg_common.py2
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py2
-rw-r--r--lib/sqlalchemy/dialects/postgresql/ext.py4
-rw-r--r--lib/sqlalchemy/dialects/postgresql/psycopg2.py4
-rw-r--r--lib/sqlalchemy/dialects/sqlite/base.py4
-rw-r--r--lib/sqlalchemy/engine/base.py2
-rw-r--r--lib/sqlalchemy/engine/default.py2
-rw-r--r--lib/sqlalchemy/engine/interfaces.py22
-rw-r--r--lib/sqlalchemy/engine/processors.py1
-rw-r--r--lib/sqlalchemy/engine/reflection.py8
-rw-r--r--lib/sqlalchemy/ext/asyncio/session.py20
-rw-r--r--lib/sqlalchemy/ext/automap.py4
-rw-r--r--lib/sqlalchemy/ext/horizontal_shard.py8
-rw-r--r--lib/sqlalchemy/ext/mypy/util.py4
-rw-r--r--lib/sqlalchemy/orm/attributes.py8
-rw-r--r--lib/sqlalchemy/orm/context.py6
-rw-r--r--lib/sqlalchemy/orm/decl_base.py2
-rw-r--r--lib/sqlalchemy/orm/dynamic.py2
-rw-r--r--lib/sqlalchemy/orm/events.py2
-rw-r--r--lib/sqlalchemy/orm/loading.py4
-rw-r--r--lib/sqlalchemy/orm/properties.py2
-rw-r--r--lib/sqlalchemy/orm/relationships.py2
-rw-r--r--lib/sqlalchemy/orm/session.py12
-rw-r--r--lib/sqlalchemy/orm/strategies.py18
-rw-r--r--lib/sqlalchemy/orm/util.py2
-rw-r--r--lib/sqlalchemy/pool/impl.py2
-rw-r--r--lib/sqlalchemy/sql/coercions.py10
-rw-r--r--lib/sqlalchemy/sql/compiler.py46
-rw-r--r--lib/sqlalchemy/sql/crud.py8
-rw-r--r--lib/sqlalchemy/sql/default_comparator.py6
-rw-r--r--lib/sqlalchemy/sql/dml.py6
-rw-r--r--lib/sqlalchemy/sql/elements.py12
-rw-r--r--lib/sqlalchemy/sql/functions.py4
-rw-r--r--lib/sqlalchemy/sql/lambdas.py2
-rw-r--r--lib/sqlalchemy/sql/schema.py34
-rw-r--r--lib/sqlalchemy/sql/selectable.py6
-rw-r--r--lib/sqlalchemy/sql/sqltypes.py2
-rw-r--r--lib/sqlalchemy/testing/plugin/pytestplugin.py2
-rw-r--r--lib/sqlalchemy/testing/suite/test_dialect.py2
-rw-r--r--lib/sqlalchemy/testing/suite/test_reflection.py4
-rw-r--r--lib/sqlalchemy/testing/util.py2
46 files changed, 161 insertions, 162 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index 48288619e..e2ffbeb09 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -2047,7 +2047,7 @@ class MSSQLCompiler(compiler.SQLCompiler):
expression.BinaryExpression(
binary.right, binary.left, binary.operator
),
- **kwargs
+ **kwargs,
)
return super(MSSQLCompiler, self).visit_binary(binary, **kwargs)
@@ -2540,7 +2540,7 @@ def _db_plus_owner_listing(fn):
dbname,
owner,
schema,
- **kw
+ **kw,
)
return update_wrapper(wrap, fn)
@@ -2559,7 +2559,7 @@ def _db_plus_owner(fn):
dbname,
owner,
schema,
- **kw
+ **kw,
)
return update_wrapper(wrap, fn)
@@ -2727,7 +2727,7 @@ class MSDialect(default.DefaultDialect):
json_serializer=None,
json_deserializer=None,
legacy_schema_aliasing=None,
- **opts
+ **opts,
):
self.query_timeout = int(query_timeout or 0)
self.schema_name = schema_name
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py
index f20b9b693..2913944f2 100644
--- a/lib/sqlalchemy/dialects/mysql/base.py
+++ b/lib/sqlalchemy/dialects/mysql/base.py
@@ -2390,7 +2390,7 @@ class MySQLDialect(default.DefaultDialect):
json_serializer=None,
json_deserializer=None,
is_mariadb=None,
- **kwargs
+ **kwargs,
):
kwargs.pop("use_ansiquotes", None) # legacy
default.DefaultDialect.__init__(self, **kwargs)
diff --git a/lib/sqlalchemy/dialects/mysql/types.py b/lib/sqlalchemy/dialects/mysql/types.py
index abbf943a9..07a67e2a4 100644
--- a/lib/sqlalchemy/dialects/mysql/types.py
+++ b/lib/sqlalchemy/dialects/mysql/types.py
@@ -74,7 +74,7 @@ class _StringType(sqltypes.String):
binary=False,
unicode=False,
national=False,
- **kw
+ **kw,
):
self.charset = charset
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py
index 94feeefce..1488fc005 100644
--- a/lib/sqlalchemy/dialects/oracle/base.py
+++ b/lib/sqlalchemy/dialects/oracle/base.py
@@ -1497,7 +1497,7 @@ class OracleDialect(default.DefaultDialect):
use_binds_for_limits=None,
use_nchar_for_unicode=False,
exclude_tablespaces=("SYSTEM", "SYSAUX"),
- **kwargs
+ **kwargs,
):
default.DefaultDialect.__init__(self, **kwargs)
self._use_nchar_for_unicode = use_nchar_for_unicode
@@ -1711,7 +1711,7 @@ class OracleDialect(default.DefaultDialect):
schema=None,
resolve_synonyms=False,
dblink="",
- **kw
+ **kw,
):
if resolve_synonyms:
@@ -2053,7 +2053,7 @@ class OracleDialect(default.DefaultDialect):
schema=None,
resolve_synonyms=False,
dblink="",
- **kw
+ **kw,
):
info_cache = kw.get("info_cache")
@@ -2090,7 +2090,7 @@ class OracleDialect(default.DefaultDialect):
schema=None,
resolve_synonyms=False,
dblink="",
- **kw
+ **kw,
):
info_cache = kw.get("info_cache")
@@ -2433,7 +2433,7 @@ class OracleDialect(default.DefaultDialect):
schema=None,
resolve_synonyms=False,
dblink="",
- **kw
+ **kw,
):
info_cache = kw.get("info_cache")
(view_name, schema, dblink, synonym) = self._prepare_reflection_args(
diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py
index 9b097fb0e..153be5610 100644
--- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py
+++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py
@@ -883,7 +883,7 @@ class OracleDialect_cx_oracle(OracleDialect):
arraysize=50,
encoding_errors=None,
threaded=None,
- **kwargs
+ **kwargs,
):
OracleDialect.__init__(self, **kwargs)
@@ -1123,7 +1123,7 @@ class OracleDialect_cx_oracle(OracleDialect):
str,
size,
cursor.arraysize,
- **dialect._cursor_var_unicode_kwargs
+ **dialect._cursor_var_unicode_kwargs,
)
elif dialect.auto_convert_lobs and default_type in (
@@ -1134,7 +1134,7 @@ class OracleDialect_cx_oracle(OracleDialect):
cx_Oracle.LONG_STRING,
size,
cursor.arraysize,
- **dialect._cursor_var_unicode_kwargs
+ **dialect._cursor_var_unicode_kwargs,
)
elif dialect.auto_convert_lobs and default_type in (
diff --git a/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py b/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
index 265d8617e..7f936fefb 100644
--- a/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
+++ b/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
@@ -114,7 +114,7 @@ class _PGDialect_common_psycopg(PGDialect):
client_encoding=None,
use_native_hstore=True,
use_native_uuid=True,
- **kwargs
+ **kwargs,
):
PGDialect.__init__(self, **kwargs)
if not use_native_hstore:
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 869e48bd4..107288a73 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -3935,7 +3935,7 @@ class PGDialect(default.DefaultDialect):
table_name,
schema=None,
postgresql_ignore_search_path=False,
- **kw
+ **kw,
):
preparer = self.identifier_preparer
table_oid = self.get_table_oid(
diff --git a/lib/sqlalchemy/dialects/postgresql/ext.py b/lib/sqlalchemy/dialects/postgresql/ext.py
index e323da8be..1eabed403 100644
--- a/lib/sqlalchemy/dialects/postgresql/ext.py
+++ b/lib/sqlalchemy/dialects/postgresql/ext.py
@@ -221,7 +221,7 @@ class ExcludeConstraint(ColumnCollectionConstraint):
*columns,
name=kw.get("name"),
deferrable=kw.get("deferrable"),
- initially=kw.get("initially")
+ initially=kw.get("initially"),
)
self.using = kw.get("using", "gist")
where = kw.get("where")
@@ -258,7 +258,7 @@ class ExcludeConstraint(ColumnCollectionConstraint):
deferrable=self.deferrable,
initially=self.initially,
where=self.where,
- using=self.using
+ using=self.using,
)
c.dispatch._update(self.dispatch)
return c
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
index 0bbad3257..d670d1a50 100644
--- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py
+++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
@@ -558,7 +558,7 @@ class PGDialect_psycopg2(_PGDialect_common_psycopg):
executemany_mode="values_only",
executemany_batch_page_size=100,
executemany_values_page_size=1000,
- **kwargs
+ **kwargs,
):
_PGDialect_common_psycopg.__init__(self, **kwargs)
@@ -737,7 +737,7 @@ class PGDialect_psycopg2(_PGDialect_common_psycopg):
parameters,
template=executemany_values,
fetch=bool(context.compiled.returning),
- **kwargs
+ **kwargs,
)
elif self.executemany_mode & EXECUTEMANY_BATCH:
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py
index 927c35135..cb607b58d 100644
--- a/lib/sqlalchemy/dialects/sqlite/base.py
+++ b/lib/sqlalchemy/dialects/sqlite/base.py
@@ -1864,7 +1864,7 @@ class SQLiteDialect(default.DefaultDialect):
json_deserializer=None,
_json_serializer=None,
_json_deserializer=None,
- **kwargs
+ **kwargs,
):
default.DefaultDialect.__init__(self, **kwargs)
@@ -2377,7 +2377,7 @@ class SQLiteDialect(default.DefaultDialect):
table_name,
schema=schema,
include_auto_indexes=True,
- **kw
+ **kw,
):
if not idx["name"].startswith("sqlite_autoindex"):
continue
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 4f8535447..4a7ad9a18 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -1455,7 +1455,7 @@ class Connection(ConnectionEventsTarget):
parameters,
execution_options,
*args,
- **kw
+ **kw,
):
"""Create an :class:`.ExecutionContext` and execute, returning
a :class:`_engine.CursorResult`."""
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 779939be8..1560b3a8e 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -258,7 +258,7 @@ class DefaultDialect(interfaces.Dialect):
# the direct reference to the "NO_LINTING" object
compiler_linting=int(compiler.NO_LINTING),
server_side_cursors=False,
- **kwargs
+ **kwargs,
):
if server_side_cursors:
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py
index 90e0ea5d2..37512fc7e 100644
--- a/lib/sqlalchemy/engine/interfaces.py
+++ b/lib/sqlalchemy/engine/interfaces.py
@@ -729,7 +729,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw
+ **kw,
) -> List[ReflectedColumn]:
"""Return information about columns in ``table_name``.
@@ -747,7 +747,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> ReflectedPrimaryKeyConstraint:
"""Return information about the primary key constraint on
table_name`.
@@ -766,7 +766,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> List[ReflectedForeignKeyConstraint]:
"""Return information about foreign_keys in ``table_name``.
@@ -833,7 +833,7 @@ class Dialect:
connection: "Connection",
view_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> str:
"""Return view definition.
@@ -849,7 +849,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> List[ReflectedIndex]:
"""Return information about indexes in ``table_name``.
@@ -867,7 +867,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> List[ReflectedUniqueConstraint]:
r"""Return information about unique constraints in ``table_name``.
@@ -884,7 +884,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> List[ReflectedCheckConstraint]:
r"""Return information about check constraints in ``table_name``.
@@ -901,7 +901,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> Dict[str, Any]:
r"""Return the "options" for the table identified by ``table_name``
as a dictionary.
@@ -913,7 +913,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> ReflectedTableComment:
r"""Return the "comment" for the table identified by ``table_name``.
@@ -956,7 +956,7 @@ class Dialect:
connection: "Connection",
table_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> bool:
"""For internal dialect use, check the existence of a particular table
or view in the database.
@@ -1017,7 +1017,7 @@ class Dialect:
connection: "Connection",
sequence_name: str,
schema: Optional[str] = None,
- **kw: Any
+ **kw: Any,
) -> bool:
"""Check the existence of a particular sequence in the database.
diff --git a/lib/sqlalchemy/engine/processors.py b/lib/sqlalchemy/engine/processors.py
index 023444d10..e05d1b0a4 100644
--- a/lib/sqlalchemy/engine/processors.py
+++ b/lib/sqlalchemy/engine/processors.py
@@ -33,7 +33,6 @@ try:
# return Decimal('5'). These are equivalent of course.
return DecimalResultProcessor(target_class, "%%.%df" % scale).process
-
except ImportError:
from ._py_processors import int_to_boolean # noqa
from ._py_processors import str_to_date # noqa
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py
index 562130f77..e1b06a314 100644
--- a/lib/sqlalchemy/engine/reflection.py
+++ b/lib/sqlalchemy/engine/reflection.py
@@ -960,7 +960,7 @@ class Inspector:
schema=referred_schema,
autoload_with=self.bind,
_extend_on=_extend_on,
- **reflection_options
+ **reflection_options,
)
for column in referred_columns:
refspec.append(
@@ -974,7 +974,7 @@ class Inspector:
autoload_with=self.bind,
schema=sa_schema.BLANK_SCHEMA,
_extend_on=_extend_on,
- **reflection_options
+ **reflection_options,
)
for column in referred_columns:
refspec.append(".".join([referred_table, column]))
@@ -988,7 +988,7 @@ class Inspector:
refspec,
conname,
link_to_name=True,
- **options
+ **options,
)
)
@@ -1054,7 +1054,7 @@ class Inspector:
name,
*idx_cols,
_table=table,
- **dict(list(dialect_options.items()) + [("unique", unique)])
+ **dict(list(dialect_options.items()) + [("unique", unique)]),
)
def _reflect_unique_constraints(
diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py
index 9beba2ee0..3b53585dd 100644
--- a/lib/sqlalchemy/ext/asyncio/session.py
+++ b/lib/sqlalchemy/ext/asyncio/session.py
@@ -190,7 +190,7 @@ class AsyncSession(ReversibleProxy):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return a buffered
:class:`_engine.Result` object.
@@ -214,7 +214,7 @@ class AsyncSession(ReversibleProxy):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
)
async def scalar(
@@ -223,7 +223,7 @@ class AsyncSession(ReversibleProxy):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return a scalar result.
@@ -238,7 +238,7 @@ class AsyncSession(ReversibleProxy):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
)
return result.scalar()
@@ -248,7 +248,7 @@ class AsyncSession(ReversibleProxy):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return scalar results.
@@ -269,7 +269,7 @@ class AsyncSession(ReversibleProxy):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
)
return result.scalars()
@@ -307,7 +307,7 @@ class AsyncSession(ReversibleProxy):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return a streaming
:class:`_asyncio.AsyncResult` object."""
@@ -325,7 +325,7 @@ class AsyncSession(ReversibleProxy):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
)
return _result.AsyncResult(result)
@@ -335,7 +335,7 @@ class AsyncSession(ReversibleProxy):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return a stream of scalar results.
@@ -356,7 +356,7 @@ class AsyncSession(ReversibleProxy):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
)
return result.scalars()
diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py
index b62c514c7..d0ead6179 100644
--- a/lib/sqlalchemy/ext/automap.py
+++ b/lib/sqlalchemy/ext/automap.py
@@ -1082,7 +1082,7 @@ def _relationships_for_fks(
referred_cls,
local_cls,
collection_class=collection_class,
- **o2m_kws
+ **o2m_kws,
)
else:
backref_obj = None
@@ -1114,7 +1114,7 @@ def _relationships_for_fks(
foreign_keys=[fk.parent for fk in constraint.elements],
back_populates=relationship_name,
collection_class=collection_class,
- **o2m_kws
+ **o2m_kws,
)
if rel is not None:
referred_cfg.properties[backref_name] = rel
diff --git a/lib/sqlalchemy/ext/horizontal_shard.py b/lib/sqlalchemy/ext/horizontal_shard.py
index 5f13ad268..71159de15 100644
--- a/lib/sqlalchemy/ext/horizontal_shard.py
+++ b/lib/sqlalchemy/ext/horizontal_shard.py
@@ -59,7 +59,7 @@ class ShardedSession(Session):
execute_chooser=None,
shards=None,
query_cls=ShardedQuery,
- **kwargs
+ **kwargs,
):
"""Construct a ShardedSession.
@@ -125,7 +125,7 @@ class ShardedSession(Session):
primary_key_identity,
identity_token=None,
lazy_loaded_from=None,
- **kw
+ **kw,
):
"""override the default :meth:`.Session._identity_lookup` method so
that we search for a given non-token primary key identity across all
@@ -141,7 +141,7 @@ class ShardedSession(Session):
mapper,
primary_key_identity,
identity_token=identity_token,
- **kw
+ **kw,
)
else:
q = self.query(mapper)
@@ -153,7 +153,7 @@ class ShardedSession(Session):
primary_key_identity,
identity_token=shard_id,
lazy_loaded_from=lazy_loaded_from,
- **kw
+ **kw,
)
if obj is not None:
return obj
diff --git a/lib/sqlalchemy/ext/mypy/util.py b/lib/sqlalchemy/ext/mypy/util.py
index 4d55cb728..595c1d2a7 100644
--- a/lib/sqlalchemy/ext/mypy/util.py
+++ b/lib/sqlalchemy/ext/mypy/util.py
@@ -193,7 +193,7 @@ def get_callexpr_kwarg(
callexpr: CallExpr,
name: str,
*,
- expr_types: Tuple[TypingType[_TArgType], ...]
+ expr_types: Tuple[TypingType[_TArgType], ...],
) -> Optional[_TArgType]:
...
@@ -202,7 +202,7 @@ def get_callexpr_kwarg(
callexpr: CallExpr,
name: str,
*,
- expr_types: Optional[Tuple[TypingType[Any], ...]] = None
+ expr_types: Optional[Tuple[TypingType[Any], ...]] = None,
) -> Optional[Any]:
try:
arg_idx = callexpr.arg_names.index(name)
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index dce008a67..09d45bef7 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -701,7 +701,7 @@ class AttributeImpl:
load_on_unexpire=True,
send_modified_events=True,
accepts_scalar_loader=None,
- **kwargs
+ **kwargs,
):
r"""Construct an AttributeImpl.
@@ -1318,7 +1318,7 @@ class CollectionAttributeImpl(AttributeImpl):
trackparent=False,
copy_function=None,
compare_function=None,
- **kwargs
+ **kwargs,
):
super(CollectionAttributeImpl, self).__init__(
class_,
@@ -1327,7 +1327,7 @@ class CollectionAttributeImpl(AttributeImpl):
dispatch,
trackparent=trackparent,
compare_function=compare_function,
- **kwargs
+ **kwargs,
)
if copy_function is None:
@@ -2081,7 +2081,7 @@ def register_attribute_impl(
useobject=False,
impl_class=None,
backref=None,
- **kw
+ **kw,
):
manager = manager_of_class(class_)
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py
index 0c1d16d0e..012db36c2 100644
--- a/lib/sqlalchemy/orm/context.py
+++ b/lib/sqlalchemy/orm/context.py
@@ -1043,7 +1043,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
statement_hints=self.select_statement._statement_hints,
correlate=self.correlate,
correlate_except=self.correlate_except,
- **self._select_args
+ **self._select_args,
)
inner = inner.alias()
@@ -1083,7 +1083,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
statement,
*self.compound_eager_adapter.copy_and_process(
unwrapped_order_by
- )
+ ),
)
statement.order_by.non_generative(statement, *self.eager_order_by)
@@ -1121,7 +1121,7 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
statement_hints=self.select_statement._statement_hints,
correlate=self.correlate,
correlate_except=self.correlate_except,
- **self._select_args
+ **self._select_args,
)
if self.eager_order_by:
diff --git a/lib/sqlalchemy/orm/decl_base.py b/lib/sqlalchemy/orm/decl_base.py
index b92ae5aa4..b6d0a19cd 100644
--- a/lib/sqlalchemy/orm/decl_base.py
+++ b/lib/sqlalchemy/orm/decl_base.py
@@ -810,7 +810,7 @@ class _ClassScanMapperConfig(_MapperConfig):
tablename,
self._metadata_for_cls(manager),
*(tuple(declared_columns) + tuple(args)),
- **table_kw
+ **table_kw,
),
)
else:
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py
index 67deb3b01..2febb4f02 100644
--- a/lib/sqlalchemy/orm/dynamic.py
+++ b/lib/sqlalchemy/orm/dynamic.py
@@ -77,7 +77,7 @@ class DynamicAttributeImpl(attributes.AttributeImpl):
target_mapper,
order_by,
query_class=None,
- **kw
+ **kw,
):
super(DynamicAttributeImpl, self).__init__(
class_, key, typecallable, dispatch, **kw
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py
index b358b8be3..a66bf64d8 100644
--- a/lib/sqlalchemy/orm/events.py
+++ b/lib/sqlalchemy/orm/events.py
@@ -219,7 +219,7 @@ class InstanceEvents(event.Events):
raw=False,
propagate=False,
restore_load_context=False,
- **kw
+ **kw,
):
target, fn = (event_key.dispatch_target, event_key._listen_fn)
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py
index a37d83cfe..047971d35 100644
--- a/lib/sqlalchemy/orm/loading.py
+++ b/lib/sqlalchemy/orm/loading.py
@@ -583,7 +583,7 @@ def _setup_entity_query(
with_polymorphic=None,
only_load_props=None,
polymorphic_discriminator=None,
- **kw
+ **kw,
):
if with_polymorphic:
@@ -616,7 +616,7 @@ def _setup_entity_query(
column_collection=column_collection,
memoized_populators=quick_populators,
check_for_adapt=check_for_adapt,
- **kw
+ **kw,
)
if (
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py
index 04b7f89c2..9e7dfeeed 100644
--- a/lib/sqlalchemy/orm/properties.py
+++ b/lib/sqlalchemy/orm/properties.py
@@ -291,7 +291,7 @@ class ColumnProperty(StrategizedProperty):
deferred=self.deferred,
group=self.group,
active_history=self.active_history,
- *self.columns
+ *self.columns,
)
def _getcommitted(
diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py
index a597d9c4f..dd58c0201 100644
--- a/lib/sqlalchemy/orm/relationships.py
+++ b/lib/sqlalchemy/orm/relationships.py
@@ -2482,7 +2482,7 @@ class RelationshipProperty(StrategizedProperty):
sj,
foreign_keys=foreign_keys,
back_populates=self.key,
- **kwargs
+ **kwargs,
)
mapper._configure_property(backref_key, relationship)
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py
index fdab20405..62e560475 100644
--- a/lib/sqlalchemy/orm/session.py
+++ b/lib/sqlalchemy/orm/session.py
@@ -1490,7 +1490,7 @@ class Session(_SessionClassMethods):
bind_arguments=None,
_parent_execute_state=None,
_add_event=None,
- **kw
+ **kw,
):
r"""Execute a SQL expression construct.
@@ -1647,7 +1647,7 @@ class Session(_SessionClassMethods):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return a scalar result.
@@ -1662,7 +1662,7 @@ class Session(_SessionClassMethods):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
).scalar()
def scalars(
@@ -1671,7 +1671,7 @@ class Session(_SessionClassMethods):
params=None,
execution_options=util.EMPTY_DICT,
bind_arguments=None,
- **kw
+ **kw,
):
"""Execute a statement and return the results as scalars.
@@ -1691,7 +1691,7 @@ class Session(_SessionClassMethods):
params=params,
execution_options=execution_options,
bind_arguments=bind_arguments,
- **kw
+ **kw,
).scalars()
def close(self):
@@ -3974,7 +3974,7 @@ class sessionmaker(_SessionClassMethods):
autoflush=True,
expire_on_commit=True,
info=None,
- **kw
+ **kw,
):
r"""Construct a new :class:`.sessionmaker`.
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py
index 844b0f007..bb42927e2 100644
--- a/lib/sqlalchemy/orm/strategies.py
+++ b/lib/sqlalchemy/orm/strategies.py
@@ -57,7 +57,7 @@ def _register_attribute(
proxy_property=None,
active_history=False,
impl_class=None,
- **kw
+ **kw,
):
listen_hooks = []
@@ -123,7 +123,7 @@ def _register_attribute(
impl_class=impl_class,
send_modified_events=not useobject or not prop.viewonly,
doc=prop.doc,
- **kw
+ **kw,
)
for hook in listen_hooks:
@@ -153,7 +153,7 @@ class UninstrumentedColumnLoader(LoaderStrategy):
loadopt,
adapter,
column_collection=None,
- **kwargs
+ **kwargs,
):
for c in self.columns:
if adapter:
@@ -196,7 +196,7 @@ class ColumnLoader(LoaderStrategy):
column_collection,
memoized_populators,
check_for_adapt=False,
- **kwargs
+ **kwargs,
):
for c in self.columns:
if adapter:
@@ -283,7 +283,7 @@ class ExpressionColumnLoader(ColumnLoader):
adapter,
column_collection,
memoized_populators,
- **kwargs
+ **kwargs,
):
columns = None
if loadopt and "expression" in loadopt.local_opts:
@@ -437,7 +437,7 @@ class DeferredColumnLoader(LoaderStrategy):
column_collection,
memoized_populators,
only_load_props=None,
- **kw
+ **kw,
):
if (
@@ -471,7 +471,7 @@ class DeferredColumnLoader(LoaderStrategy):
adapter,
column_collection,
memoized_populators,
- **kw
+ **kw,
)
elif self.is_class_level:
memoized_populators[self.parent_property] = _SET_DEFERRED_EXPIRED
@@ -1350,7 +1350,7 @@ class SubqueryLoader(PostLoader):
orig_query, compile_state=orig_compile_state
)
if ent["entity"] is not None
- }
+ },
)
# select from the identity columns of the outer (specifically, these
@@ -1934,7 +1934,7 @@ class JoinedLoader(AbstractRelationshipLoader):
column_collection=None,
parentmapper=None,
chained_from_outerjoin=False,
- **kwargs
+ **kwargs,
):
"""Add a left outer join to the statement that's being constructed."""
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index b6983a036..a282adea4 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -1572,7 +1572,7 @@ class Bundle(
expression.ClauseList(
_literal_as_text_role=roles.ColumnsClauseRole,
group=False,
- *[e._annotations.get("bundle", e) for e in self.exprs]
+ *[e._annotations.get("bundle", e) for e in self.exprs],
)
._annotate(annotations)
._set_propagate_attrs(
diff --git a/lib/sqlalchemy/pool/impl.py b/lib/sqlalchemy/pool/impl.py
index 3ef33d02d..f478186d5 100644
--- a/lib/sqlalchemy/pool/impl.py
+++ b/lib/sqlalchemy/pool/impl.py
@@ -44,7 +44,7 @@ class QueuePool(Pool):
max_overflow=10,
timeout=30.0,
use_lifo=False,
- **kw
+ **kw,
):
r"""
Construct a QueuePool.
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py
index 1a0336c67..d11ab6712 100644
--- a/lib/sqlalchemy/sql/coercions.py
+++ b/lib/sqlalchemy/sql/coercions.py
@@ -115,7 +115,7 @@ def expect(
apply_propagate_attrs=None,
argname=None,
post_inspect=False,
- **kw
+ **kw,
):
if (
role.allows_lambda
@@ -205,7 +205,7 @@ def expect(
resolved,
argname=argname,
original_element=original_element,
- **kw
+ **kw,
)
return resolved
else:
@@ -441,7 +441,7 @@ class _SelectIsNotFrom:
resolved=resolved,
advice=advice,
code=code,
- **kw
+ **kw,
)
@@ -956,7 +956,7 @@ class FromClauseImpl(_SelectIsNotFrom, _NoTextCoercion, RoleImpl):
argname=None,
explicit_subquery=False,
allow_select=True,
- **kw
+ **kw,
):
if resolved._is_select_statement:
if explicit_subquery:
@@ -991,7 +991,7 @@ class StrictFromClauseImpl(FromClauseImpl):
resolved,
argname=None,
allow_select=False,
- **kw
+ **kw,
):
if resolved._is_select_statement and allow_select:
util.warn_deprecated(
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 90f32a4f7..cea6d97b8 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -694,7 +694,7 @@ class SQLCompiler(Compiled):
column_keys=None,
for_executemany=False,
linting=NO_LINTING,
- **kwargs
+ **kwargs,
):
"""Construct a new :class:`.SQLCompiler` object.
@@ -1369,7 +1369,7 @@ class SQLCompiler(Compiled):
return self.process(
element.element,
within_columns_clause=within_columns_clause,
- **kwargs
+ **kwargs,
)
def visit_textual_label_reference(
@@ -1410,7 +1410,7 @@ class SQLCompiler(Compiled):
within_columns_clause=False,
render_label_as_label=None,
result_map_targets=(),
- **kw
+ **kw,
):
# only render labels within the columns clause
# or ORDER BY clause of a select. dialect-specific compilers
@@ -1439,7 +1439,7 @@ class SQLCompiler(Compiled):
self,
within_columns_clause=True,
within_label_clause=True,
- **kw
+ **kw,
)
+ OPERATORS[operators.as_]
+ self.preparer.format_label(label, labelname)
@@ -1466,7 +1466,7 @@ class SQLCompiler(Compiled):
add_to_result_map=None,
include_table=True,
result_map_targets=(),
- **kwargs
+ **kwargs,
):
name = orig_name = column.name
if name is None:
@@ -2135,7 +2135,7 @@ class SQLCompiler(Compiled):
eager_grouping=False,
from_linter=None,
lateral_from_linter=None,
- **kw
+ **kw,
):
if from_linter and operators.is_comparison(binary.operator):
if lateral_from_linter is not None:
@@ -2176,7 +2176,7 @@ class SQLCompiler(Compiled):
opstring,
from_linter=from_linter,
lateral_from_linter=lateral_from_linter,
- **kw
+ **kw,
)
def visit_function_as_comparison_op_binary(self, element, operator, **kw):
@@ -2201,7 +2201,7 @@ class SQLCompiler(Compiled):
return self._generate_generic_binary(
element,
" " + self.escape_literal_column(operator.opstring) + " ",
- **kw
+ **kw,
)
def visit_custom_op_unary_operator(self, element, operator, **kw):
@@ -2339,7 +2339,7 @@ class SQLCompiler(Compiled):
return self._generate_generic_binary(
binary,
" NOT BETWEEN SYMMETRIC " if symmetric else " NOT BETWEEN ",
- **kw
+ **kw,
)
def visit_regexp_match_op_binary(self, binary, operator, **kw):
@@ -2368,7 +2368,7 @@ class SQLCompiler(Compiled):
skip_bind_expression=False,
literal_execute=False,
render_postcompile=False,
- **kwargs
+ **kwargs,
):
if not skip_bind_expression:
impl = bindparam.type.dialect_impl(self.dialect)
@@ -2381,7 +2381,7 @@ class SQLCompiler(Compiled):
literal_binds=literal_binds,
literal_execute=literal_execute,
render_postcompile=render_postcompile,
- **kwargs
+ **kwargs,
)
if bindparam.expanding:
# for postcompile w/ expanding, move the "wrapped" part
@@ -2478,7 +2478,7 @@ class SQLCompiler(Compiled):
post_compile=post_compile,
expanding=bindparam.expanding,
bindparam_type=bindparam.type,
- **kwargs
+ **kwargs,
)
if bindparam.expanding:
@@ -2576,7 +2576,7 @@ class SQLCompiler(Compiled):
expanding=False,
escaped_from=None,
bindparam_type=None,
- **kw
+ **kw,
):
if self.positional:
@@ -2624,7 +2624,7 @@ class SQLCompiler(Compiled):
fromhints=None,
visiting_cte=None,
from_linter=None,
- **kwargs
+ **kwargs,
):
self._init_cte_state()
@@ -2813,7 +2813,7 @@ class SQLCompiler(Compiled):
lateral=False,
enclosing_alias=None,
from_linter=None,
- **kwargs
+ **kwargs,
):
if lateral:
@@ -2842,7 +2842,7 @@ class SQLCompiler(Compiled):
fromhints=fromhints,
lateral=lateral,
enclosing_alias=alias,
- **kwargs
+ **kwargs,
)
if subquery and (asfrom or lateral):
inner = "(%s)" % (inner,)
@@ -2929,7 +2929,7 @@ class SQLCompiler(Compiled):
elements.Tuple(
types=element._column_types, *elem
).self_group(),
- **kw
+ **kw,
)
for chunk in element._data
for elem in chunk
@@ -3233,7 +3233,7 @@ class SQLCompiler(Compiled):
select_wraps_for=None,
lateral=False,
from_linter=None,
- **kwargs
+ **kwargs,
):
assert select_wraps_for is None, (
"SQLAlchemy 1.4 requires use of "
@@ -3526,7 +3526,7 @@ class SQLCompiler(Compiled):
asfrom=True,
fromhints=byfrom,
from_linter=from_linter,
- **kwargs
+ **kwargs,
)
for f in froms
]
@@ -3538,7 +3538,7 @@ class SQLCompiler(Compiled):
self,
asfrom=True,
from_linter=from_linter,
- **kwargs
+ **kwargs,
)
for f in froms
]
@@ -3732,7 +3732,7 @@ class SQLCompiler(Compiled):
fromhints=None,
use_schema=True,
from_linter=None,
- **kwargs
+ **kwargs,
):
if from_linter:
from_linter.froms[table] = table.fullname
@@ -4054,7 +4054,7 @@ class SQLCompiler(Compiled):
update_stmt.table,
render_extra_froms,
dialect_hints,
- **kw
+ **kw,
)
if extra_from_text:
text += " " + extra_from_text
@@ -4164,7 +4164,7 @@ class SQLCompiler(Compiled):
delete_stmt.table,
extra_froms,
dialect_hints,
- **kw
+ **kw,
)
if extra_from_text:
text += " " + extra_from_text
diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py
index a313257ca..27bc08081 100644
--- a/lib/sqlalchemy/sql/crud.py
+++ b/lib/sqlalchemy/sql/crud.py
@@ -494,7 +494,7 @@ def _append_param_parameter(
name=_col_bind_name(c)
if not compile_state._has_multi_parameters
else "%s_m0" % _col_bind_name(c),
- **kw
+ **kw,
)
elif value._is_bind_parameter:
value = _handle_values_anonymous_param(
@@ -504,7 +504,7 @@ def _append_param_parameter(
name=_col_bind_name(c)
if not compile_state._has_multi_parameters
else "%s_m0" % _col_bind_name(c),
- **kw
+ **kw,
)
else:
# value is a SQL expression
@@ -881,7 +881,7 @@ def _get_update_multitable_params(
value,
required=value is REQUIRED,
name=_col_bind_name(c),
- **kw # TODO: no test coverage for literal binds here
+ **kw, # TODO: no test coverage for literal binds here
)
elif value._is_bind_parameter:
value = _handle_values_anonymous_param(
@@ -949,7 +949,7 @@ def _extend_values_for_multiparams(
col,
row[key],
name="%s_m%d" % (col.key, i + 1),
- **kw
+ **kw,
)
else:
new_param = compiler.process(row[key].self_group(), **kw)
diff --git a/lib/sqlalchemy/sql/default_comparator.py b/lib/sqlalchemy/sql/default_comparator.py
index 2bbead673..d849f8aba 100644
--- a/lib/sqlalchemy/sql/default_comparator.py
+++ b/lib/sqlalchemy/sql/default_comparator.py
@@ -36,7 +36,7 @@ def _boolean_compare(
_python_is_types=(util.NoneType, bool),
_any_all_expr=False,
result_type=None,
- **kwargs
+ **kwargs,
):
if result_type is None:
@@ -215,7 +215,7 @@ def _match_impl(expr, op, other, **kw):
negate=operators.not_match_op
if op is operators.match_op
else operators.match_op,
- **kw
+ **kw,
)
@@ -275,7 +275,7 @@ def _regexp_match_impl(expr, op, pattern, flags, **kw):
negate=operators.not_regexp_match_op
if op is operators.regexp_match_op
else operators.regexp_match_op,
- **kw
+ **kw,
)
diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py
index ab0a05651..feb286d65 100644
--- a/lib/sqlalchemy/sql/dml.py
+++ b/lib/sqlalchemy/sql/dml.py
@@ -854,7 +854,7 @@ class Insert(ValuesBase):
prefixes=None,
returning=None,
return_defaults=False,
- **dialect_kw
+ **dialect_kw,
):
"""Construct an :class:`_expression.Insert` object.
@@ -1165,7 +1165,7 @@ class Update(DMLWhereBase, ValuesBase):
returning=None,
return_defaults=False,
preserve_parameter_order=False,
- **dialect_kw
+ **dialect_kw,
):
r"""Construct an :class:`_expression.Update` object.
@@ -1384,7 +1384,7 @@ class Delete(DMLWhereBase, UpdateBase):
whereclause=None,
returning=None,
prefixes=None,
- **dialect_kw
+ **dialect_kw,
):
r"""Construct :class:`_expression.Delete` object.
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index f6606e01d..6e5fbba88 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -516,7 +516,7 @@ class ClauseElement(
column_keys=None,
for_executemany=False,
schema_translate_map=None,
- **kw
+ **kw,
):
if compiled_cache is not None and dialect._supports_statement_cache:
elem_cache_key = self._generate_cache_key()
@@ -542,7 +542,7 @@ class ClauseElement(
column_keys=column_keys,
for_executemany=for_executemany,
schema_translate_map=schema_translate_map,
- **kw
+ **kw,
)
compiled_cache[key] = compiled_sql
else:
@@ -555,7 +555,7 @@ class ClauseElement(
column_keys=column_keys,
for_executemany=for_executemany,
schema_translate_map=schema_translate_map,
- **kw
+ **kw,
)
if not dialect._supports_statement_cache:
@@ -4134,7 +4134,7 @@ class Over(ColumnElement):
if partition_by is not None:
self.partition_by = ClauseList(
*util.to_list(partition_by),
- _literal_as_text_role=roles.ByOfRole
+ _literal_as_text_role=roles.ByOfRole,
)
if range_:
@@ -4667,7 +4667,7 @@ class NamedColumn(ColumnElement):
name=None,
name_is_truncatable=False,
disallow_is_literal=False,
- **kw
+ **kw,
):
c = ColumnClause(
coercions.expect(roles.TruncatedLabelRole, name or self.name)
@@ -4965,7 +4965,7 @@ class ColumnClause(
name=None,
name_is_truncatable=False,
disallow_is_literal=False,
- **kw
+ **kw,
):
# the "is_literal" flag normally should never be propagated; a proxied
# column is always a SQL identifier and never the actual expression
diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py
index fa0b06421..29f2ce868 100644
--- a/lib/sqlalchemy/sql/functions.py
+++ b/lib/sqlalchemy/sql/functions.py
@@ -580,7 +580,7 @@ class FunctionElement(Executable, ColumnElement, FromClause, Generative):
_compared_to_type=self.type,
unique=True,
type_=type_,
- **kw
+ **kw,
)
def self_group(self, against=None):
@@ -867,7 +867,7 @@ class Function(FunctionElement):
_compared_to_type=self.type,
type_=type_,
unique=True,
- **kw
+ **kw,
)
diff --git a/lib/sqlalchemy/sql/lambdas.py b/lib/sqlalchemy/sql/lambdas.py
index da1dbedbb..b2c366671 100644
--- a/lib/sqlalchemy/sql/lambdas.py
+++ b/lib/sqlalchemy/sql/lambdas.py
@@ -314,7 +314,7 @@ class LambdaElement(elements.ClauseElement):
self._resolved = clone(
self._resolved,
deferred_copy_internals=deferred_copy_internals,
- **kw
+ **kw,
)
@util.memoized_property
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py
index dd8238450..a5fdd39d4 100644
--- a/lib/sqlalchemy/sql/schema.py
+++ b/lib/sqlalchemy/sql/schema.py
@@ -680,7 +680,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
self._init_items(
*args,
- allow_replacements=extend_existing or keep_existing or autoload
+ allow_replacements=extend_existing or keep_existing or autoload,
)
def _autoload(
@@ -1049,7 +1049,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
schema=schema,
comment=self.comment,
*args,
- **self.kwargs
+ **self.kwargs,
)
for c in self.constraints:
if isinstance(c, ForeignKeyConstraint):
@@ -1087,7 +1087,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
for expr in index.expressions
],
_table=table,
- **index.kwargs
+ **index.kwargs,
)
return self._schema_item_copy(table)
@@ -1892,7 +1892,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause):
doc=self.doc,
comment=self.comment,
*args,
- **column_kwargs
+ **column_kwargs,
)
return self._schema_item_copy(c)
@@ -1930,7 +1930,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause):
primary_key=self.primary_key,
nullable=self.nullable,
_proxies=[self],
- *fk
+ *fk,
)
except TypeError as err:
raise TypeError(
@@ -2007,7 +2007,7 @@ class ForeignKey(DialectKWArgs, SchemaItem):
link_to_name=False,
match=None,
info=None,
- **dialect_kw
+ **dialect_kw,
):
r"""
Construct a column-level FOREIGN KEY.
@@ -2150,7 +2150,7 @@ class ForeignKey(DialectKWArgs, SchemaItem):
initially=self.initially,
link_to_name=self.link_to_name,
match=self.match,
- **self._unvalidated_dialect_kw
+ **self._unvalidated_dialect_kw,
)
return self._schema_item_copy(fk)
@@ -2421,7 +2421,7 @@ class ForeignKey(DialectKWArgs, SchemaItem):
deferrable=self.deferrable,
initially=self.initially,
match=self.match,
- **self._unvalidated_dialect_kw
+ **self._unvalidated_dialect_kw,
)
self.constraint._append_element(column, self)
self.constraint._set_parent_with_dispatch(table)
@@ -3021,7 +3021,7 @@ class Constraint(DialectKWArgs, SchemaItem):
_create_rule=None,
info=None,
_type_bound=False,
- **dialect_kw
+ **dialect_kw,
):
r"""Create a SQL constraint.
@@ -3266,7 +3266,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint):
_copy_expression(expr, self.parent, target_table)
for expr in self.columns
],
- **constraint_kwargs
+ **constraint_kwargs,
)
return self._schema_item_copy(c)
@@ -3314,7 +3314,7 @@ class CheckConstraint(ColumnCollectionConstraint):
_create_rule=None,
_autoattach=True,
_type_bound=False,
- **kw
+ **kw,
):
r"""Construct a CHECK constraint.
@@ -3358,7 +3358,7 @@ class CheckConstraint(ColumnCollectionConstraint):
_type_bound=_type_bound,
_autoattach=_autoattach,
*columns,
- **kw
+ **kw,
)
if table is not None:
self._set_parent_with_dispatch(table)
@@ -3426,7 +3426,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint):
match=None,
table=None,
info=None,
- **dialect_kw
+ **dialect_kw,
):
r"""Construct a composite-capable FOREIGN KEY.
@@ -3505,7 +3505,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint):
deferrable=deferrable,
initially=initially,
info=info,
- **dialect_kw
+ **dialect_kw,
)
self.onupdate = onupdate
self.ondelete = ondelete
@@ -3546,7 +3546,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint):
match=self.match,
deferrable=self.deferrable,
initially=self.initially,
- **self.dialect_kwargs
+ **self.dialect_kwargs,
)
for refcol in refcolumns
]
@@ -4055,7 +4055,7 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem):
self,
*expressions,
_column_flag=_column_flag,
- _gather_expressions=self.expressions
+ _gather_expressions=self.expressions,
)
if table is not None:
@@ -4423,7 +4423,7 @@ class MetaData(SchemaItem):
extend_existing=False,
autoload_replace=True,
resolve_fks=True,
- **dialect_kwargs
+ **dialect_kwargs,
):
r"""Load all available table definitions from the database.
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index b53235a83..9c5850761 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -2697,7 +2697,7 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause):
whereclause=whereclause,
values=values,
inline=inline,
- **kwargs
+ **kwargs,
)
@util.preload_module("sqlalchemy.sql.dml")
@@ -5001,7 +5001,7 @@ class Select(
onclause=None,
*,
isouter=False,
- full=False
+ full=False,
) -> SelfSelect:
r"""Create a SQL JOIN against this :class:`_expression.Select`
object's criterion
@@ -5340,7 +5340,7 @@ class Select(
*util.preloaded.sql_util.reduce_columns(
self._all_selected_columns,
only_synonyms=only_synonyms,
- *(self._where_criteria + self._from_obj)
+ *(self._where_criteria + self._from_obj),
)
)
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py
index cda7b35cd..cb44fc086 100644
--- a/lib/sqlalchemy/sql/sqltypes.py
+++ b/lib/sqlalchemy/sql/sqltypes.py
@@ -926,7 +926,7 @@ class SchemaType(SchemaEventTarget):
inherit_schema=self.inherit_schema,
metadata=metadata,
_create_events=_create_events,
- **kw
+ **kw,
)
def create(self, bind, checkfirst=False):
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py
index 02cb0ac32..8679a9f12 100644
--- a/lib/sqlalchemy/testing/plugin/pytestplugin.py
+++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py
@@ -647,7 +647,7 @@ class PytestFixtureFunctions(plugin_base.FixtureFunctions):
idx
for idx, char in enumerate(id_)
if char in ("n", "r", "s", "a")
- ]
+ ],
)
fns = [
(operator.itemgetter(idx), _combination_id_fns[char])
diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py b/lib/sqlalchemy/testing/suite/test_dialect.py
index daaea085d..aeb1991d1 100644
--- a/lib/sqlalchemy/testing/suite/test_dialect.py
+++ b/lib/sqlalchemy/testing/suite/test_dialect.py
@@ -70,7 +70,7 @@ class ExceptionTest(fixtures.TablesTest):
# there's no way to make this happen with some drivers like
# mysqlclient, pymysql. this at least does produce a non-
# ascii error message for cx_oracle, psycopg2
- conn.execute(select(literal_column(u"méil")))
+ conn.execute(select(literal_column("méil")))
assert False
except exc.DBAPIError as err:
err_str = str(err)
diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py
index 9287f76de..6f02d5557 100644
--- a/lib/sqlalchemy/testing/suite/test_reflection.py
+++ b/lib/sqlalchemy/testing/suite/test_reflection.py
@@ -495,7 +495,7 @@ class ComponentReflectionTest(fixtures.TablesTest):
# https://www.arbinada.com/en/node/1645
sa.UniqueConstraint("name", name="user_tmp_uq_%s" % config.ident),
sa.Index("user_tmp_ix", "foo"),
- **kw
+ **kw,
)
if (
testing.requires.view_reflection.enabled
@@ -1286,7 +1286,7 @@ class ComponentReflectionTestExtra(fixtures.TestBase):
t = Table(
"t",
metadata,
- *[Column("t%d" % i, type_) for i, type_ in enumerate(types)]
+ *[Column("t%d" % i, type_) for i, type_ in enumerate(types)],
)
t.create(connection)
diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py
index 982e57517..8cb92e808 100644
--- a/lib/sqlalchemy/testing/util.py
+++ b/lib/sqlalchemy/testing/util.py
@@ -275,7 +275,7 @@ def flag_combinations(*combinations):
for d in combinations
],
id_="i" + ("a" * len(keys)),
- argnames=",".join(keys)
+ argnames=",".join(keys),
)