]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Update Black's target-version to py37
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Wed, 5 Jan 2022 17:41:32 +0000 (12:41 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Wed, 5 Jan 2022 17:41:32 +0000 (12:41 -0500)
<!-- 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

83 files changed:
.pre-commit-config.yaml
doc/build/conf.py
examples/versioned_history/history_meta.py
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/mysql/types.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/ext.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/engine/processors.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/ext/automap.py
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/ext/mypy/util.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/decl_base.py
lib/sqlalchemy/orm/dynamic.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/pool/impl.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/crud.py
lib/sqlalchemy/sql/default_comparator.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/lambdas.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/testing/plugin/pytestplugin.py
lib/sqlalchemy/testing/suite/test_dialect.py
lib/sqlalchemy/testing/suite/test_reflection.py
lib/sqlalchemy/testing/util.py
pyproject.toml
test/aaa_profiling/test_memusage.py
test/aaa_profiling/test_orm.py
test/aaa_profiling/test_resultset.py
test/dialect/mssql/test_reflection.py
test/dialect/mysql/test_reflection.py
test/dialect/oracle/test_dialect.py
test/dialect/oracle/test_types.py
test/dialect/postgresql/test_async_pg_py3k.py
test/dialect/postgresql/test_dialect.py
test/dialect/postgresql/test_reflection.py
test/dialect/postgresql/test_types.py
test/dialect/test_sqlite.py
test/engine/test_parseconnect.py
test/engine/test_reconnect.py
test/engine/test_reflection.py
test/ext/test_associationproxy.py
test/ext/test_automap.py
test/ext/test_baked.py
test/ext/test_horizontal_shard.py
test/orm/inheritance/test_poly_persistence.py
test/orm/test_attributes.py
test/orm/test_inspect.py
test/orm/test_rel_fn.py
test/orm/test_relationship_criteria.py
test/orm/test_relationships.py
test/sql/test_constraints.py
test/sql/test_deprecations.py
test/sql/test_metadata.py
test/sql/test_quote.py
test/sql/test_text.py
test/sql/test_types.py
test/sql/test_update.py
tox.ini

index ae35977b9d0c027262f324fe0113c8e809331959..80138c26a1a0f7dc40d4a7535d5dd05503e53bbf 100644 (file)
@@ -2,27 +2,27 @@
 # See https://pre-commit.com/hooks.html for more hooks
 repos:
 -   repo: https://github.com/python/black
-    rev: 21.5b1
+    rev: 21.12b0
     hooks:
     -   id: black
 
 -   repo: https://github.com/sqlalchemyorg/zimports
-    rev: v0.4.0
+    rev: v0.4.1
     hooks:
     -   id: zimports
         args:
             - --keep-unused-type-checking
 
 -   repo: https://github.com/pycqa/flake8
-    rev: 3.9.2
+    rev: 4.0.1
     hooks:
     -   id: flake8
         additional_dependencies:
           - flake8-import-order
           - flake8-builtins
-          - flake8-docstrings>=1.3.1
+          - flake8-docstrings>=1.6.0
           - flake8-rst-docstrings
-          # flake8-rst-docstrings depdendency, leaving it here
+          # flake8-rst-docstrings dependency, leaving it here
           # in case it requires a version pin
           - pydocstyle
           - pygments
index cba0fee6ab9f9e9a63661e51902b4d9ad4a1b663..6f5a83b969cff3bc432de4aa87b22cb0cd805fc7 100644 (file)
@@ -196,8 +196,8 @@ zzzeeksphinx_module_prefixes = {
 master_doc = "contents"
 
 # General information about the project.
-project = u"SQLAlchemy"
-copyright = u"2007-2021, the SQLAlchemy authors and contributors"  # noqa
+project = "SQLAlchemy"
+copyright = "2007-2021, the SQLAlchemy authors and contributors"  # noqa
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -401,8 +401,8 @@ man_pages = [
     (
         "index",
         "sqlalchemy",
-        u"SQLAlchemy Documentation",
-        [u"SQLAlchemy authors"],
+        "SQLAlchemy Documentation",
+        ["SQLAlchemy authors"],
         1,
     )
 ]
@@ -411,10 +411,10 @@ man_pages = [
 # -- Options for Epub output -------------------------------------------------
 
 # Bibliographic Dublin Core info.
-epub_title = u"SQLAlchemy"
-epub_author = u"SQLAlchemy authors"
-epub_publisher = u"SQLAlchemy authors"
-epub_copyright = u"2007-2015, SQLAlchemy authors"
+epub_title = "SQLAlchemy"
+epub_author = "SQLAlchemy authors"
+epub_publisher = "SQLAlchemy authors"
+epub_copyright = "2007-2015, SQLAlchemy authors"
 
 # The language of the text. It defaults to the language option
 # or en if the language is not set.
index 214f75e6b6b76d9e8af7cb111047848013dc4e04..23bdc1e6f8587b79afa4ca00f98c8a666d96053f 100644 (file)
@@ -128,7 +128,7 @@ def _history_mapper(local_mapper):
             local_mapper.local_table.name + "_history",
             local_mapper.local_table.metadata,
             *cols,
-            schema=local_mapper.local_table.schema
+            schema=local_mapper.local_table.schema,
         )
     else:
         # single table inheritance.  take any additional columns that may have
index 48288619eec039e176b862dec59d429f5391793f..e2ffbeb09ea6ea557ffef6703fa30d32a086a7ce 100644 (file)
@@ -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
index f20b9b6931e8ac43e65566ce0f72a9ba7f1d2725..2913944f272d73912c7006326311a530d1bdc768 100644 (file)
@@ -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)
index abbf943a9a728b6a97e6e01aca051696f5979dd2..07a67e2a49b5f289e2b44f562db4220d42218207 100644 (file)
@@ -74,7 +74,7 @@ class _StringType(sqltypes.String):
         binary=False,
         unicode=False,
         national=False,
-        **kw
+        **kw,
     ):
         self.charset = charset
 
index 94feeefcea52844d7897490f5f636a72b302e644..1488fc0052f5c904ebe02aefcb5b965f67d63152 100644 (file)
@@ -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(
index 9b097fb0e949dea83efbd508b4961ee9b195cae6..153be56106f7e7baa9e1e6dd2b2e08ac62626534 100644 (file)
@@ -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 (
index 265d8617e1f397c60114b612cf739822ef36ee92..7f936fefbfeeae369c9ff39aeaba4ddf948adca3 100644 (file)
@@ -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:
index 869e48bd4142c16d5d1f96ba46de1493f2a404ad..107288a73e8fd244180411297143b048d7815471 100644 (file)
@@ -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(
index e323da8bec7b6a8d30778429285ff68917eb2509..1eabed4030829eeaf3a7795dca8af0780287ab1c 100644 (file)
@@ -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
index 0bbad3257cab9397dc87acf371bbc6afd3579840..d670d1a50810cfbcc25bc905fb52a2aa87e85a8c 100644 (file)
@@ -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:
index 927c35135e56ee680905ab09329d22bd39b9cd11..cb607b58d62c86c68a261c96dd80bf8a1256bbb5 100644 (file)
@@ -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
index 4f85354472379b8014401c5b646cf8a7f31e95ec..4a7ad9a181fb1788aef03ab90872d1e36f28a414 100644 (file)
@@ -1455,7 +1455,7 @@ class Connection(ConnectionEventsTarget):
         parameters,
         execution_options,
         *args,
-        **kw
+        **kw,
     ):
         """Create an :class:`.ExecutionContext` and execute, returning
         a :class:`_engine.CursorResult`."""
index 779939be81adc104773027561b5f6f361cddc4a1..1560b3a8e701d5a25fb871b0067ed762a9a26634 100644 (file)
@@ -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:
index 90e0ea5d2db437f32dd7fc8d13b82c4215cdbddb..37512fc7e4f0be947878ac95a75a24ad8bca7fac 100644 (file)
@@ -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.
 
index 023444d10008017748cb12396517e57a1170584f..e05d1b0a4c4a980adc1a1c48ae93987a9e5170d7 100644 (file)
@@ -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
index 562130f77be2ca47404da3bde8463d0c448faf52..e1b06a3149773537887f25e83deadff332b5a527 100644 (file)
@@ -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(
index 9beba2ee0dc5f8b401cfffcd79734eaa08804590..3b53585ddbecd1c4a7c356f42b1a7201fa02bba8 100644 (file)
@@ -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()
 
index b62c514c7bd9c9b27afe71df19020cccd4f21e5c..d0ead6179ee88eea9f5b5ddeb5992de34c4ebdae 100644 (file)
@@ -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
index 5f13ad268901cbf675cbb9b2aaa51b663c862f55..71159de1563e48f45ebcccdcd28a55e6e043d943 100644 (file)
@@ -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
index 4d55cb72833fe911de69f3fc78c00a728308fb47..595c1d2a7f2d134e2ea6c009baf7e400c1efff8a 100644 (file)
@@ -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)
index dce008a67b49fcf58bbf04e8c3e75287fb991491..09d45bef7f662da24276ddd76fc10861ad4f27e7 100644 (file)
@@ -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_)
index 0c1d16d0e2747f158609b893a023d89668f3eb38..012db36c2cd0e9c25fc2bf14c7debbfe071f9c94 100644 (file)
@@ -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:
index b92ae5aa48483322b7d7c0bbc5bccb756e175b2c..b6d0a19cd07a18144444479d8b9520103e5dd9cb 100644 (file)
@@ -810,7 +810,7 @@ class _ClassScanMapperConfig(_MapperConfig):
                         tablename,
                         self._metadata_for_cls(manager),
                         *(tuple(declared_columns) + tuple(args)),
-                        **table_kw
+                        **table_kw,
                     ),
                 )
         else:
index 67deb3b0196c375d58dd31f35ab5e951e4a1cf35..2febb4f020107691011c85017d7f206a4147b69d 100644 (file)
@@ -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
index b358b8be355b6cf2692e510bbb45d42b2d40c46f..a66bf64d8cf9424882396418e2d4d0c71981bf9d 100644 (file)
@@ -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)
 
index a37d83cfeae35145d9afb75b4b399843fb46521d..047971d3562ed118bd1b865abea42c4a75297747 100644 (file)
@@ -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 (
index 04b7f89c2b73cbfb80210ed5f5908cc70dc639d8..9e7dfeeedf90082de52c10fa50b1ed755a42bf5d 100644 (file)
@@ -291,7 +291,7 @@ class ColumnProperty(StrategizedProperty):
             deferred=self.deferred,
             group=self.group,
             active_history=self.active_history,
-            *self.columns
+            *self.columns,
         )
 
     def _getcommitted(
index a597d9c4f7fd716d00e473161ef6f024188553c4..dd58c0201d6fe7275647a5d6536fa0bcea353cec 100644 (file)
@@ -2482,7 +2482,7 @@ class RelationshipProperty(StrategizedProperty):
                 sj,
                 foreign_keys=foreign_keys,
                 back_populates=self.key,
-                **kwargs
+                **kwargs,
             )
             mapper._configure_property(backref_key, relationship)
 
index fdab20405cb5ace0ffa1c959457d686c5b4a6305..62e5604756f20b93e75352ebb28282fcbe4cee16 100644 (file)
@@ -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`.
 
index 844b0f007ac603a6ebcfa482e2dfa482d588a863..bb42927e20fd669c7c0372ea76cc630c038fb345 100644 (file)
@@ -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."""
 
index b6983a0360028a71e5982ac5c7fdf9f26803c8f3..a282adea4b9967d500c21e5b2b525947e274cc84 100644 (file)
@@ -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(
index 3ef33d02d2b4475c9933ff40730d00679b5f10fe..f478186d5c674ae512f12b6a0b7cebe9dcd92304 100644 (file)
@@ -44,7 +44,7 @@ class QueuePool(Pool):
         max_overflow=10,
         timeout=30.0,
         use_lifo=False,
-        **kw
+        **kw,
     ):
         r"""
         Construct a QueuePool.
index 1a0336c67583fedd471a13952c4d7eeedf47118b..d11ab6712b19c63eacdeac5b9b27488960503ce0 100644 (file)
@@ -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(
index 90f32a4f7cecfbc3a70072faf9fdfa6677d205d4..cea6d97b8f0876caf40d8b15b87a25402d2380ae 100644 (file)
@@ -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
index a313257ca330f207a003ea77386ccd5f1fc56d2d..27bc0808146944bbf9715ff1215e73191bbd8e46 100644 (file)
@@ -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)
index 2bbead673031b53c4e23213801b20577cdafafe9..d849f8aba7e402b299b84d0bac25c7c8a5833e2d 100644 (file)
@@ -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,
     )
 
 
index ab0a05651b0fbc61c82c9d56919ae856e1ce8f7e..feb286d659d3da6f48375812a11df8b24e5afed9 100644 (file)
@@ -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.
 
index f6606e01d5ce0528a2a613267a481934e1ccadf8..6e5fbba88970db50b412436ba8890647d2ddfd86 100644 (file)
@@ -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
index fa0b06421b67862ad313b971d8ded4b6c54bb12e..29f2ce8686b6ae4fe9ded5dc2f13ea95f15cc4dd 100644 (file)
@@ -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,
         )
 
 
index da1dbedbb5d0b35d86f99100e0d3f371e2dfa3ea..b2c36667105a8ebe354c87b0c991a3833d997819 100644 (file)
@@ -314,7 +314,7 @@ class LambdaElement(elements.ClauseElement):
         self._resolved = clone(
             self._resolved,
             deferred_copy_internals=deferred_copy_internals,
-            **kw
+            **kw,
         )
 
     @util.memoized_property
index dd8238450ce81201f2260ffe1e00224e4fdd9fb0..a5fdd39d41b86287c6d95c07b52cbaa46a696d57 100644 (file)
@@ -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.
 
index b53235a83600c479fdddc36a39c87d7df08bc67d..9c5850761fea6781f85b534bf92d64ab5fb64f05 100644 (file)
@@ -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),
             )
         )
 
index cda7b35cda052e8ded24298f99f4c87ab74f51b1..cb44fc0861f9c466475ee3b7c30af4f8ae2419ea 100644 (file)
@@ -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):
index 02cb0ac3283b204a2e90a9764fe3f47fc6af297d..8679a9f12b47ae85dd71079ad5e0f581b8aa5a07 100644 (file)
@@ -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])
index daaea085d9062208e793d50ecedf7fe8f2f73278..aeb1991d1de0e146c485357277f1017711166dd1 100644 (file)
@@ -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)
index 9287f76dec36bbd6cd6ae0da18336bdcdc483dbc..6f02d55577c701441821b1d435ec73f18dcccbdc 100644 (file)
@@ -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)
 
index 982e5751777d69ea0e6401b67e1871fb0ff560ae..8cb92e8083aba7e5bca38ef34d0b87869d49ad50 100644 (file)
@@ -275,7 +275,7 @@ def flag_combinations(*combinations):
             for d in combinations
         ],
         id_="i" + ("a" * len(keys)),
-        argnames=",".join(keys)
+        argnames=",".join(keys),
     )
 
 
index 7523d67e5a47331768033b79239d6baeb99e5020..9b0b3dfc72bb42217ae0b53957954337182b5e64 100644 (file)
@@ -8,4 +8,4 @@
 
 [tool.black]
 line-length = 79
-target-version = ['py27', 'py36']
+target-version = ['py37']
index 42f8823665a9d8e8f0d604362f9ee19c4fc9bc69..316e7d7d469051f51db095931e23d2359918e290 100644 (file)
@@ -553,7 +553,7 @@ class MemUsageWBackendTest(fixtures.MappedTest, EnsureZeroed):
             Column(
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
-            *[Column("col%d" % i, Integer) for i in range(10)]
+            *[Column("col%d" % i, Integer) for i in range(10)],
         )
 
         class Wide:
index 113286d1ba40a6eac72a77b1cf19bef43cf9ca88..128a78714fce6e33a50b109af0aac53c8221a04f 100644 (file)
@@ -375,7 +375,7 @@ class DeferOptionsTest(NoCache, fixtures.MappedTest):
                     **dict(
                         (letter, "%s%d" % (letter, i))
                         for letter in ["x", "y", "z", "p", "q", "r"]
-                    )
+                    ),
                 )
                 for i in range(1, 1001)
             ]
@@ -722,7 +722,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
             Column(
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "b",
@@ -731,7 +731,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("a_id", ForeignKey("a.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "c",
@@ -740,7 +740,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("b_id", ForeignKey("b.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "d",
@@ -749,7 +749,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("c_id", ForeignKey("c.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "e",
@@ -758,7 +758,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("a_id", ForeignKey("a.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "f",
@@ -767,7 +767,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("e_id", ForeignKey("e.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "g",
@@ -776,7 +776,7 @@ class JoinedEagerLoadTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("e_id", ForeignKey("e.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
 
     @classmethod
@@ -1024,7 +1024,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
             Column(
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "b",
@@ -1033,7 +1033,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("a_id", ForeignKey("a.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "c",
@@ -1042,7 +1042,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("b_id", ForeignKey("b.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "d",
@@ -1051,7 +1051,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("b_id", ForeignKey("b.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "e",
@@ -1060,7 +1060,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("b_id", ForeignKey("b.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "f",
@@ -1069,7 +1069,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("b_id", ForeignKey("b.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
         Table(
             "g",
@@ -1078,7 +1078,7 @@ class BranchedOptionTest(NoCache, fixtures.MappedTest):
                 "id", Integer, primary_key=True, test_needs_autoincrement=True
             ),
             Column("a_id", ForeignKey("a.id")),
-            *make_some_columns()
+            *make_some_columns(),
         )
 
     @classmethod
index 12921a7dc3e4b39af7d649750fc474fc34a225ff..479a2472f44ceec1f40fb0e226f12063a509aa44 100644 (file)
@@ -29,7 +29,7 @@ class ResultSetTest(fixtures.TablesTest, AssertsExecutionResults):
             *[
                 Column("field%d" % fnum, String(50))
                 for fnum in range(NUM_FIELDS)
-            ]
+            ],
         )
         Table(
             "table2",
@@ -37,7 +37,7 @@ class ResultSetTest(fixtures.TablesTest, AssertsExecutionResults):
             *[
                 Column("field%d" % fnum, Unicode(50))
                 for fnum in range(NUM_FIELDS)
-            ]
+            ],
         )
 
     @classmethod
index f877d2c5c774efc45535a01547e0261a06c15994..1489f9a6d9f7c6fbd9fbd789f81e08d8f131c40e 100644 (file)
@@ -260,12 +260,12 @@ class ReflectionTest(fixtures.TestBase, ComparesTables, AssertsCompiledSQL):
                 [
                     {
                         "id": 1,
-                        "txt": u"foo",
+                        "txt": "foo",
                         "dt2": datetime.datetime(2020, 1, 1, 1, 1, 1),
                     },
                     {
                         "id": 2,
-                        "txt": u"bar",
+                        "txt": "bar",
                         "dt2": datetime.datetime(2020, 2, 2, 2, 2, 2),
                     },
                 ],
@@ -587,7 +587,7 @@ class ReflectHugeViewTest(fixtures.TablesTest):
             *[
                 Column("long_named_column_number_%d" % i, Integer)
                 for i in range(col_num)
-            ]
+            ],
         )
         cls.view_str = (
             view_str
index 08c7d9a4d2c3ed0a4a5d0ee44b071390384174f0..f414c9c376f5adca02d8e5c057dd2f6f8a2d0b82 100644 (file)
@@ -327,7 +327,7 @@ class ReflectionTest(fixtures.TestBase, AssertsCompiledSQL):
             metadata,
             Column("c1", Integer()),
             comment=comment,
-            **kwargs
+            **kwargs,
         )
 
         conn = connection
index 18996c3f9cc9e382c38617ce2a6cb8d685014a95..c06baace03b6421f6550949aecc959ac51b64e09 100644 (file)
@@ -501,7 +501,7 @@ class CompatFlagsTest(fixtures.TestBase, AssertsCompiledSQL):
                 version="0.0.0",
                 paramstyle="named",
             ),
-            **kw
+            **kw,
         )
 
         dialect._get_server_version_info = server_version_info
index d9a350947fca86ca909622b0ffcb5ce5fa94653c..715a90000c16cfa597720e8f06eb936363f79601 100644 (file)
@@ -1003,11 +1003,11 @@ class LOBFetchTest(fixtures.TablesTest):
         long_text.create(connection)
 
         if isinstance(datatype, UnicodeText):
-            word_seed = u"ab🐍’«cdefg"
+            word_seed = "ab🐍’«cdefg"
         else:
             word_seed = "abcdef"
 
-        some_text = u" ".join(
+        some_text = " ".join(
             "".join(random.choice(word_seed) for j in range(150))
             for i in range(datasize)
         )
@@ -1033,9 +1033,9 @@ class LOBFetchTest(fixtures.TablesTest):
         )
         long_text.create(connection)
 
-        word_seed = u"ab🐍’«cdefg"
+        word_seed = "ab🐍’«cdefg"
 
-        some_text = u" ".join(
+        some_text = " ".join(
             "".join(random.choice(word_seed) for j in range(10))
             for i in range(15)
         )
index 782cf33dd39cad6ea0f2fc184694ed935c42220b..4ccc847dcc5b7ca87e79fdfbacc131bc21c732c0 100644 (file)
@@ -120,7 +120,7 @@ class AsyncPgTest(fixtures.TestBase):
                 "name",
                 ENUM(
                     *("beans", "means", "keens", "faux", "beau", "flow"),
-                    name="my_enum"
+                    name="my_enum",
                 ),
             ),
         )
index 02d7ad483ec5b3ff82a536212600432b66786e41..cd6c127b8c9064e99799ece345f9f13ccfca2e5e 100644 (file)
@@ -374,7 +374,7 @@ class ExecuteManyMode:
                         {"x": "x2", "y": "y2"},
                         {"x": "x3", "y": "y3"},
                     ),
-                    **expected_kwargs
+                    **expected_kwargs,
                 )
             ],
         )
@@ -423,7 +423,7 @@ class ExecuteManyMode:
                         {"x": "x2", "y": "y2"},
                         {"x": "x3", "y": "y3"},
                     ),
-                    **expected_kwargs
+                    **expected_kwargs,
                 )
             ],
         )
@@ -476,7 +476,7 @@ class ExecuteManyMode:
                         {"x": "x2", "y": "y2"},
                         {"x": "x3", "y": "y3"},
                     ),
-                    **expected_kwargs
+                    **expected_kwargs,
                 )
             ],
         )
@@ -529,7 +529,7 @@ class ExecuteManyMode:
                             {"xval": "x1", "yval": "y5"},
                             {"xval": "x3", "yval": "y6"},
                         ),
-                        **expected_kwargs
+                        **expected_kwargs,
                     )
                 ],
             )
index 0e8a18c0fcf54240aae0df0ae4aa588371df87a4..fa04dee480837564a0c9b417dc011504d2e6df2d 100644 (file)
@@ -1698,10 +1698,10 @@ class ReflectionTest(
         eq_(
             check_constraints,
             {
-                u"cc1": u"(a > 1) AND (a < 5)",
-                u"cc2": u"(a = 1) OR ((a > 2) AND (a < 5))",
-                u"cc3": u"is_positive(a)",
-                u"cc4": u"(b)::text <> 'hi\nim a name   \nyup\n'::text",
+                "cc1": "(a > 1) AND (a < 5)",
+                "cc2": "(a = 1) OR ((a > 2) AND (a < 5))",
+                "cc3": "is_positive(a)",
+                "cc4": "(b)::text <> 'hi\nim a name   \nyup\n'::text",
             },
         )
 
index 69b06403e428c6455fa2fa336e07fca173c2f27c..f3993976211a90d4e64f117d0c13915b396d9da3 100644 (file)
@@ -1515,14 +1515,14 @@ class ArrayRoundTripTest:
                 {
                     "id": 1,
                     "intarr": [1, 2, 3],
-                    "strarr": [u"one", u"two", u"three"],
+                    "strarr": ["one", "two", "three"],
                 },
                 {
                     "id": 2,
                     "intarr": [4, 5, 6],
-                    "strarr": [u"four", u"five", u"six"],
+                    "strarr": ["four", "five", "six"],
                 },
-                {"id": 3, "intarr": [1, 5], "strarr": [u"one", u"five"]},
+                {"id": 3, "intarr": [1, 5], "strarr": ["one", "five"]},
                 {"id": 4, "intarr": [], "strarr": []},
             ],
         )
@@ -1556,9 +1556,9 @@ class ArrayRoundTripTest:
             .where(
                 arrtable.c.strarr.in_(
                     [
-                        [u"one", u"five"],
-                        [u"four", u"five", u"six"],
-                        [u"nine", u"ten"],
+                        ["one", "five"],
+                        ["four", "five", "six"],
+                        ["nine", "ten"],
                     ]
                 )
             )
index 141033c1b6b66c183c50e2e0f9412e3a8769bec8..516730159b77041082356d9680ce19ad7401212a 100644 (file)
@@ -2278,8 +2278,8 @@ class ConstraintReflectionTest(fixtures.TestBase):
             [
                 {
                     "unique": 0,
-                    "name": u"ix_main_l_bar",
-                    "column_names": [u"bar"],
+                    "name": "ix_main_l_bar",
+                    "column_names": ["bar"],
                 }
             ],
         )
index 19fce5c1897e820c8a508b6a15de5e07ba1573a2..00d9390b4ca116ea027f737cfc88f709acbcea85 100644 (file)
@@ -319,7 +319,7 @@ class URLTest(fixtures.TestBase):
             "%s must be a string" % argname,
             url.URL.create,
             "somedriver",
-            **{argname: value}
+            **{argname: value},
         )
 
     @testing.combinations("username", "host", "database", argnames="argname")
@@ -352,7 +352,7 @@ class URLTest(fixtures.TestBase):
             TypeError,
             "%s must be a string" % argname,
             u1.set,
-            **{argname: 35.8}
+            **{argname: 35.8},
         )
 
     def test_only_str_query_key_constructor(self):
index f37d1893f0f0f3e5e8dc5634ebf2f316b79e3bf7..74b5b2df5a005c8cad12d7de53f0adc026aab2b4 100644 (file)
@@ -173,7 +173,7 @@ class PrePingMockTest(fixtures.TestBase):
             creator=lambda: self.dbapi.connect("foo.db"),
             pre_ping=pre_ping,
             dialect=dialect,
-            **(pool_kw if pool_kw else {})
+            **(pool_kw if pool_kw else {}),
         )
 
         dialect.is_disconnect = lambda e, conn, cursor: isinstance(
index efd30071ef7ccefc51363cce0f6708332f9c353e..42c83d87b4f29a9797533b3b34ecc0c78d002582 100644 (file)
@@ -257,7 +257,10 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
         foo = Table(
             "foo",
             meta,
-            *[Column(n, sa.String(30)) for n in ["a", "b", "c", "d", "e", "f"]]
+            *[
+                Column(n, sa.String(30))
+                for n in ["a", "b", "c", "d", "e", "f"]
+            ],
         )
         meta.create_all(connection)
         meta2 = MetaData()
index 93da104de7b42420e31cae8c94b7ddad80f1f6d1..3fa7b4999f71a8b519c12d439fb272e55499a67e 100644 (file)
@@ -3095,7 +3095,7 @@ class MultiOwnerTest(
             "Association proxy D.c refers to an attribute 'csub_only_data'",
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
     def _assert_raises_attribute(self, message, fn, *arg, **kw):
index 625bb8da25db103156e11669ce7ba4a2172728ab..df60a9a6534f33ee5cc6c53f60494098bc947fb9 100644 (file)
@@ -287,7 +287,7 @@ class AutomapTest(fixtures.MappedTest):
                 attrname,
                 local_cls,
                 referred_cls,
-                **kw
+                **kw,
             )
 
         Base.prepare(generate_relationship=_gen_relationship)
index a06bbf46b686ab1250abef3fa819e59527bf7f91..7bb428ea138d139e503eabc6e3ad1f1ef9d2ab28 100644 (file)
@@ -746,7 +746,7 @@ class ResultTest(BakedTest):
                 result = bq(sess).all()
 
                 if cond1:
-                    eq_(result, [(8, u"ed"), (9, u"fred"), (10, u"chuck")])
+                    eq_(result, [(8, "ed"), (9, "fred"), (10, "chuck")])
                 else:
                     eq_(result, [(7, "jack")])
 
@@ -993,7 +993,7 @@ class CustomIntegrationTest(testing.AssertsCompiledSQL, BakedTest):
                     Address,
                     order_by=self.tables.addresses.c.id,
                     lazy=lazy,
-                    **kw
+                    **kw,
                 )
             },
         )
index e25e8c8ab96061e43b6f1fd4e13edd9374334464..a59956062576e8afd2fd59dcf73711369b2fc54e 100644 (file)
@@ -902,7 +902,7 @@ class RefreshDeferExpireTest(fixtures.DeclarativeMappedTest):
             shard_chooser=lambda *args: "main",
             id_chooser=lambda *args: ["fake", "main"],
             execute_chooser=lambda *args: ["fake", "main"],
-            **kw
+            **kw,
         )
 
     def test_refresh(self):
index 8c03a40d643a177a0b09a3bed858abdbfc336402..319456b2e99790ddc330f8b3012e5a65163f72ab 100644 (file)
@@ -334,13 +334,13 @@ class RoundTripTest(PolymorphTest):
             Manager(
                 status="AAB",
                 manager_name="manager1",
-                **{person_attribute_name: "pointy haired boss"}
+                **{person_attribute_name: "pointy haired boss"},
             ),
             Engineer(
                 status="BBA",
                 engineer_name="engineer1",
                 primary_language="java",
-                **{person_attribute_name: "dilbert"}
+                **{person_attribute_name: "dilbert"},
             ),
         ]
         if include_base:
@@ -350,12 +350,12 @@ class RoundTripTest(PolymorphTest):
                 status="CGG",
                 engineer_name="engineer2",
                 primary_language="python",
-                **{person_attribute_name: "wally"}
+                **{person_attribute_name: "wally"},
             ),
             Manager(
                 status="ABA",
                 manager_name="manager2",
-                **{person_attribute_name: "jsmith"}
+                **{person_attribute_name: "jsmith"},
             ),
         ]
 
@@ -567,7 +567,7 @@ class RoundTripTest(PolymorphTest):
             status="BBB",
             manager_name="boss",
             golf_swing="fore",
-            **{person_attribute_name: "daboss"}
+            **{person_attribute_name: "daboss"},
         )
         session.add(daboss)
         assert_raises(sa_exc.DBAPIError, session.flush)
index 08de5d3d97e0538d3b3b44f1187e80fc179b2637..7c0aeabb4b3ec1183ba3e8c11dba530690839eb2 100644 (file)
@@ -1782,7 +1782,7 @@ class HistoryTest(fixtures.TestBase):
             uselist=uselist,
             useobject=useobject,
             active_history=active_history,
-            **kw
+            **kw,
         )
         return Foo
 
index f468fc5c249cba206557da02e47cdc8bcfb3bbb7..b14f16c3c749b6f375da9331b4a8576d0d25ded4 100644 (file)
@@ -560,7 +560,7 @@ class %s(SuperCls):
             "t",
             m,
             Column("id", Integer, primary_key=True),
-            *[Column(name, Integer) for name in names]
+            *[Column(name, Integer) for name in names],
         )
 
         m = self.mapper_registry.map_imperatively(MyClass, t)
index dfce8e38294a9d60e323c2eecbf693e3ba1100e8..ea292a43e40a8d8c75ecca9bba60bff5242eef24 100644 (file)
@@ -213,7 +213,7 @@ class _JoinFixtures:
             self.m2mleft,
             self.m2mright,
             secondary=self.m2msecondary,
-            **kw
+            **kw,
         )
 
     def _join_fixture_m2m_backref(self, **kw):
@@ -257,7 +257,7 @@ class _JoinFixtures:
             self.selfref,
             self.selfref,
             remote_side=set([self.selfref.c.id]),
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_composite_selfref(self, **kw):
@@ -266,7 +266,7 @@ class _JoinFixtures:
             self.composite_selfref,
             self.composite_selfref,
             self.composite_selfref,
-            **kw
+            **kw,
         )
 
     def _join_fixture_m2o_composite_selfref(self, **kw):
@@ -281,7 +281,7 @@ class _JoinFixtures:
                     self.composite_selfref.c.group_id,
                 ]
             ),
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_composite_selfref_func(self, **kw):
@@ -296,7 +296,7 @@ class _JoinFixtures:
                 self.composite_selfref.c.parent_id
                 == self.composite_selfref.c.id,
             ),
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_composite_selfref_func_remote_side(self, **kw):
@@ -312,7 +312,7 @@ class _JoinFixtures:
                 == self.composite_selfref.c.id,
             ),
             remote_side=set([self.composite_selfref.c.parent_id]),
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_composite_selfref_func_annotated(self, **kw):
@@ -327,7 +327,7 @@ class _JoinFixtures:
                 remote(self.composite_selfref.c.parent_id)
                 == self.composite_selfref.c.id,
             ),
-            **kw
+            **kw,
         )
 
     def _join_fixture_compound_expression_1(self, **kw):
@@ -340,7 +340,7 @@ class _JoinFixtures:
             == relationships.remote(
                 relationships.foreign(self.right.c.x * self.right.c.y)
             ),
-            **kw
+            **kw,
         )
 
     def _join_fixture_compound_expression_2(self, **kw):
@@ -351,7 +351,7 @@ class _JoinFixtures:
             self.right,
             primaryjoin=(self.left.c.x + self.left.c.y)
             == relationships.foreign(self.right.c.x * self.right.c.y),
-            **kw
+            **kw,
         )
 
     def _join_fixture_compound_expression_1_non_annotated(self, **kw):
@@ -362,7 +362,7 @@ class _JoinFixtures:
             self.right,
             primaryjoin=(self.left.c.x + self.left.c.y)
             == (self.right.c.x * self.right.c.y),
-            **kw
+            **kw,
         )
 
     def _join_fixture_base_to_joined_sub(self, **kw):
@@ -377,7 +377,7 @@ class _JoinFixtures:
             self.base_w_sub_rel,
             self.rel_sub,
             primaryjoin=self.base_w_sub_rel.c.sub_id == self.rel_sub.c.id,
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_joined_sub_to_base(self, **kw):
@@ -460,7 +460,7 @@ class _JoinFixtures:
             self.left,
             self.right,
             primaryjoin=self.left.c.id == foreign(func.foo(self.right.c.lid)),
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_to_oldstyle_func(self, **kw):
@@ -471,7 +471,7 @@ class _JoinFixtures:
             self.right,
             primaryjoin=self.left.c.id == func.foo(self.right.c.lid),
             consider_as_foreign_keys={self.right.c.lid},
-            **kw
+            **kw,
         )
 
     def _join_fixture_overlapping_composite_fks(self, **kw):
@@ -484,7 +484,7 @@ class _JoinFixtures:
                 self.composite_multi_ref.c.uid2,
                 self.composite_multi_ref.c.oid,
             },
-            **kw
+            **kw,
         )
 
     def _join_fixture_o2m_o_side_none(self, **kw):
@@ -496,7 +496,7 @@ class _JoinFixtures:
             primaryjoin=and_(
                 self.left.c.id == self.right.c.lid, self.left.c.x == 5
             ),
-            **kw
+            **kw,
         )
 
     def _join_fixture_purely_single_o2m(self, **kw):
@@ -595,7 +595,7 @@ class _JoinFixtures:
             % (primary, expr, relname),
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
     def _assert_raises_no_equality(
@@ -614,7 +614,7 @@ class _JoinFixtures:
             % (primary, expr, relname),
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
     def _assert_raises_ambig_join(
@@ -634,7 +634,7 @@ class _JoinFixtures:
                 % (relname, secondary_arg),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
         else:
             assert_raises_message(
@@ -645,7 +645,7 @@ class _JoinFixtures:
                 % (relname,),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
 
     def _assert_raises_no_join(self, fn, relname, secondary_arg, *arg, **kw):
@@ -662,7 +662,7 @@ class _JoinFixtures:
                 "'secondaryjoin' expressions" % (relname, secondary_arg),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
         else:
             assert_raises_message(
@@ -676,7 +676,7 @@ class _JoinFixtures:
                 "expression." % (relname,),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
 
 
index d8d3844cd1136e8c2f576389154ff6d86a01ef33..90d8aba2d32183c7e2fea2bf11603a564aa7ef2f 100644 (file)
@@ -1070,7 +1070,7 @@ class TemporalFixtureTest(testing.fixtures.DeclarativeMappedTest):
                     datetime.datetime(2009, 10, 16, 12, 00, 00),
                     datetime.datetime(2009, 10, 18, 12, 00, 00),
                 ),
-                *loader_options
+                *loader_options,
             )
         )
         if is_joined:
@@ -1090,7 +1090,7 @@ class TemporalFixtureTest(testing.fixtures.DeclarativeMappedTest):
                     datetime.datetime(2009, 10, 15, 11, 00, 00),
                     datetime.datetime(2009, 10, 18, 12, 00, 00),
                 ),
-                *loader_options
+                *loader_options,
             )
         )
         if is_joined:
index 9ceaf4b6c8470f089f3e155074a54d065c40d8e2..2050ca2b7554705422bde93ee5a615f4054eca2f 100644 (file)
@@ -62,7 +62,7 @@ class _RelationshipErrors:
             % (primary, expr, relname),
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
     def _assert_raises_no_equality(
@@ -81,7 +81,7 @@ class _RelationshipErrors:
             % (primary, expr, relname),
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
     def _assert_raises_ambig_join(
@@ -101,7 +101,7 @@ class _RelationshipErrors:
                 % (relname, secondary_arg),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
         else:
             assert_raises_message(
@@ -115,7 +115,7 @@ class _RelationshipErrors:
                 "foreign key reference to the parent table." % (relname,),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
 
     def _assert_raises_no_join(self, fn, relname, secondary_arg, *arg, **kw):
@@ -132,7 +132,7 @@ class _RelationshipErrors:
                 "'secondaryjoin' expressions" % (relname, secondary_arg),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
         else:
             assert_raises_message(
@@ -146,7 +146,7 @@ class _RelationshipErrors:
                 "expression." % (relname,),
                 fn,
                 *arg,
-                **kw
+                **kw,
             )
 
     def _assert_raises_ambiguous_direction(self, fn, relname, *arg, **kw):
@@ -161,7 +161,7 @@ class _RelationshipErrors:
             "via the foreign_keys argument." % relname,
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
     def _assert_raises_no_local_remote(self, fn, relname, *arg, **kw):
@@ -176,7 +176,7 @@ class _RelationshipErrors:
             % (relname),
             fn,
             *arg,
-            **kw
+            **kw,
         )
 
 
index 8c1fa54243bfa0c5567b7f039feb6a67e38838d9..2661e6c8fd416b10d8fc746771e8369de3475744 100644 (file)
@@ -1026,7 +1026,7 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL):
             Column("a", Integer),
             Column("b", Integer),
             Column("c", Integer),
-            *fkcs
+            *fkcs,
         )
         Table("remote", m, Column("id", Integer, primary_key=True))
 
index 1a839a5f82fa0057ded44169e4edc67272e1ea28..ea075b36d2a2ca2ea885937b80dd103e73276dd5 100644 (file)
@@ -1294,7 +1294,7 @@ class DMLTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
                 (t, combination)
                 for i, combination in zip(range(10), combinations())
             ],
-            argnames="t, idx_to_value"
+            argnames="t, idx_to_value",
         )
 
     @random_update_order_parameters()
index b9abe4e71bd65231f352f92dcbdf91f404ccee5a..8a9c868be3009d462982ed5cbd6afd4aebad3bd9 100644 (file)
@@ -1941,7 +1941,7 @@ class TableTest(fixtures.TestBase, AssertsCompiledSQL):
                 "a",
                 metadata,
                 Column("foo", String, primary_key=True),
-                **_kwargs
+                **_kwargs,
             )
             eq_(getattr(table_a, attrib), _attrib_value)
             eq_(getattr(metadata.tables["a"], attrib), _attrib_value)
index 67954d9ce40defb839471a0d1621f1ce8ca1b94c..07003abcb58008dd77f69dbc503c115d3263b777 100644 (file)
@@ -248,9 +248,9 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
         )
 
     def test_repr_unicode(self):
-        name = quoted_name(u"姓名", None)
+        name = quoted_name("姓名", None)
 
-        eq_(repr(name), repr(u"姓名"))
+        eq_(repr(name), repr("姓名"))
 
     def test_lower_case_names(self):
         # Create table with quote defaults
@@ -999,7 +999,7 @@ class NameNormalizeTest(fixtures.TestBase):
         ("NAME", "name", False),
         ("NA ME", "NA ME", False),
         ("NaMe", "NaMe", False),
-        (u"姓名", u"姓名", False),
+        ("姓名", "姓名", False),
         ("name", "name", True),  # an all-lower case name needs quote forced
     )
     def test_name_normalize(self, original, normalized, is_quote):
@@ -1015,7 +1015,7 @@ class NameNormalizeTest(fixtures.TestBase):
         ("name", "NAME", False),
         ("NA ME", "NA ME", False),
         ("NaMe", "NaMe", False),
-        (u"姓名", u"姓名", False),
+        ("姓名", "姓名", False),
         (quoted_name("name", quote=True), "name", True),
     )
     def test_name_denormalize(self, original, denormalized, is_quote):
index 4fff0ed7ef39bc1f6032349d408578a3d77badae..81b20f86f063a5550d5b75f672c1f190ddfbe94a 100644 (file)
@@ -786,7 +786,7 @@ class TextErrorsTest(fixtures.TestBase, AssertsCompiledSQL):
             r"explicitly declared (?:with|as) text\(%(stmt)r\)"
             % {"stmt": util.ellipses_string(offending_clause)},
             fn,
-            *arg
+            *arg,
         )
 
     def test_where(self):
index d930464a61bbdf1528ee87d6400c193e93c906ec..fb1bdad2e65e12e89cb636f1115e0f77847a8c11 100644 (file)
@@ -533,7 +533,7 @@ class _UserDefinedTypeFixture:
 
             def process_bind_param(self, value, dialect):
                 if value is None:
-                    value = u"<null value>"
+                    value = "<null value>"
                 return "BIND_IN" + value
 
             def process_result_value(self, value, dialect):
@@ -575,7 +575,7 @@ class _UserDefinedTypeFixture:
 
                 def process(value):
                     if value is None:
-                        value = u"<null value>"
+                        value = "<null value>"
 
                     return "BIND_IN" + impl_processor(value)
 
@@ -2417,7 +2417,7 @@ class EnumTest(AssertsCompiledSQL, fixtures.TablesTest):
                     *[v.name for v in values],
                     name="myenum",
                     native_enum=False,
-                    create_constraint=True
+                    create_constraint=True,
                 )
 
             # future method
index f59f02a7b15368c9ee7d2d21fac7ba127d562b47..619cbd863b185a59c482bd02e1ae6d3bdb65c7c6 100644 (file)
@@ -829,7 +829,7 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
                 (t, combination)
                 for i, combination in zip(range(10), combinations())
             ],
-            argnames="t, idx_to_value"
+            argnames="t, idx_to_value",
         )
 
     @random_update_order_parameters()
diff --git a/tox.ini b/tox.ini
index 715f8d27b1f866ac7829bfee736c21a07435e635..def210826091c1766ec5f486e208530632ef6325 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -144,13 +144,13 @@ deps=
       flake8
       flake8-import-order
       flake8-builtins
-      flake8-docstrings>=1.3.1
+      flake8-docstrings>=1.6.0
       flake8-rst-docstrings
       # flake8-rst-docstrings dependency, leaving it here
       # in case it requires a version pin
       pydocstyle
       pygments
-      black==21.5b1
+      black==21.12b0
 commands =
      flake8 ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py {posargs}
      black --check ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py