]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update to black 26.3.1
authorFederico Caselli <cfederico87@gmail.com>
Fri, 8 May 2026 20:48:58 +0000 (22:48 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sun, 10 May 2026 17:01:56 +0000 (19:01 +0200)
Closes: #13280
Change-Id: Ifbb77dd6d2a1c228ae97fcf8160f40e975edc57c
(cherry picked from commit 1e1c0084b1804eaae8b7f089435241a2b8f4be60)

191 files changed:
.pre-commit-config.yaml
doc/build/changelog/migration_20.rst
doc/build/core/connections.rst
doc/build/faq/sqlexpressions.rst
doc/build/orm/dataclasses.rst
doc/build/orm/declarative_tables.rst
examples/asyncio/basic.py
examples/custom_attributes/custom_management.py
examples/dogpile_caching/environment.py
examples/dogpile_caching/helloworld.py
examples/dogpile_caching/relationship_caching.py
examples/graphs/directed_graph.py
examples/inheritance/concrete.py
examples/inheritance/joined.py
examples/materialized_paths/materialized_paths.py
examples/nested_sets/nested_sets.py
examples/performance/__main__.py
examples/performance/bulk_updates.py
examples/performance/large_resultsets.py
examples/performance/short_selects.py
examples/performance/single_inserts.py
examples/sharding/asyncio.py
examples/sharding/separate_databases.py
examples/sharding/separate_schema_translates.py
examples/space_invaders/space_invaders.py
examples/versioned_rows/versioned_update_old_row.py
lib/sqlalchemy/connectors/aioodbc.py
lib/sqlalchemy/dialects/_typing.py
lib/sqlalchemy/dialects/mssql/__init__.py
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mssql/information_schema.py
lib/sqlalchemy/dialects/mssql/pymssql.py
lib/sqlalchemy/dialects/mssql/pyodbc.py
lib/sqlalchemy/dialects/mysql/aiomysql.py
lib/sqlalchemy/dialects/mysql/asyncmy.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/mysql/cymysql.py
lib/sqlalchemy/dialects/mysql/dml.py
lib/sqlalchemy/dialects/mysql/mariadbconnector.py
lib/sqlalchemy/dialects/mysql/mysqlconnector.py
lib/sqlalchemy/dialects/mysql/mysqldb.py
lib/sqlalchemy/dialects/mysql/pymysql.py
lib/sqlalchemy/dialects/mysql/pyodbc.py
lib/sqlalchemy/dialects/mysql/reflection.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/oracle/oracledb.py
lib/sqlalchemy/dialects/oracle/vector.py
lib/sqlalchemy/dialects/postgresql/__init__.py
lib/sqlalchemy/dialects/postgresql/dml.py
lib/sqlalchemy/dialects/postgresql/hstore.py
lib/sqlalchemy/dialects/postgresql/operators.py
lib/sqlalchemy/dialects/postgresql/pg8000.py
lib/sqlalchemy/dialects/postgresql/psycopg.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/dialects/postgresql/psycopg2cffi.py
lib/sqlalchemy/dialects/sqlite/aiosqlite.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/dialects/sqlite/pysqlite.py
lib/sqlalchemy/engine/_py_processors.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/engine/cursor.py
lib/sqlalchemy/engine/mock.py
lib/sqlalchemy/engine/processors.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/event/api.py
lib/sqlalchemy/event/attr.py
lib/sqlalchemy/event/base.py
lib/sqlalchemy/event/legacy.py
lib/sqlalchemy/event/registry.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/ext/__init__.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/ext/asyncio/engine.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/ext/automap.py
lib/sqlalchemy/ext/baked.py
lib/sqlalchemy/ext/compiler.py
lib/sqlalchemy/ext/declarative/extensions.py
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/ext/instrumentation.py
lib/sqlalchemy/ext/mypy/plugin.py
lib/sqlalchemy/ext/orderinglist.py
lib/sqlalchemy/ext/serializer.py
lib/sqlalchemy/future/__init__.py
lib/sqlalchemy/inspection.py
lib/sqlalchemy/log.py
lib/sqlalchemy/orm/collections.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/dependency.py
lib/sqlalchemy/orm/descriptor_props.py
lib/sqlalchemy/orm/dynamic.py
lib/sqlalchemy/orm/evaluator.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/instrumentation.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/persistence.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/unitofwork.py
lib/sqlalchemy/pool/impl.py
lib/sqlalchemy/sql/_orm_types.py
lib/sqlalchemy/sql/_py_util.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/crud.py
lib/sqlalchemy/sql/ddl.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/sql/lambdas.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/testing/engines.py
lib/sqlalchemy/testing/fixtures/mypy.py
lib/sqlalchemy/testing/plugin/bootstrap.py
lib/sqlalchemy/testing/plugin/pytestplugin.py
lib/sqlalchemy/testing/profiling.py
lib/sqlalchemy/testing/provision.py
lib/sqlalchemy/testing/suite/test_reflection.py
lib/sqlalchemy/testing/util.py
lib/sqlalchemy/types.py
lib/sqlalchemy/util/_collections.py
lib/sqlalchemy/util/compat.py
lib/sqlalchemy/util/langhelpers.py
lib/sqlalchemy/util/preloaded.py
lib/sqlalchemy/util/queue.py
lib/sqlalchemy/util/tool_support.py
pyproject.toml
reap_dbs.py
test/aaa_profiling/test_compiler.py
test/aaa_profiling/test_resultset.py
test/base/test_examples.py
test/conftest.py
test/dialect/mssql/test_query.py
test/dialect/oracle/test_dialect.py
test/dialect/oracle/test_reflection.py
test/dialect/postgresql/test_dialect.py
test/dialect/postgresql/test_reflection.py
test/engine/test_parseconnect.py
test/engine/test_pool.py
test/engine/test_reflection.py
test/ext/mypy/plugin_files/abstract_one.py
test/ext/mypy/plugin_files/cols_noninferred_plain_nonopt.py
test/ext/mypy/plugin_files/decl_attrs_one.py
test/ext/mypy/plugin_files/decl_attrs_two.py
test/ext/mypy/plugin_files/imperative_table.py
test/ext/mypy/plugin_files/issue_7321.py
test/ext/mypy/plugin_files/issue_7321_part2.py
test/ext/mypy/plugin_files/mixin_not_mapped.py
test/ext/mypy/plugin_files/mixin_one.py
test/ext/mypy/plugin_files/mixin_two.py
test/ext/mypy/plugin_files/mixin_w_tablename.py
test/ext/mypy/plugin_files/sa_module_prefix.py
test/ext/mypy/plugin_files/typing_err3.py
test/ext/test_extendedattr.py
test/ext/test_orderinglist.py
test/orm/_fixtures.py
test/orm/declarative/test_basic.py
test/orm/declarative/test_tm_future_annotations.py
test/orm/declarative/test_tm_future_annotations_sync.py
test/orm/declarative/test_typed_mapping.py
test/orm/test_attributes.py
test/orm/test_froms.py
test/orm/test_joins.py
test/orm/test_naturalpks.py
test/orm/test_selectable.py
test/orm/test_unitofwork.py
test/perf/invalidate_stresstest.py
test/perf/orm2010.py
test/sql/test_compiler.py
test/sql/test_functions.py
test/sql/test_query.py
test/sql/test_selectable.py
test/typing/plain_files/engine/engine_inspection.py
test/typing/plain_files/ext/asyncio/async_stuff.py
test/typing/plain_files/orm/sessionmakers.py
test/typing/plain_files/orm/traditional_relationship.py
test/typing/plain_files/orm/typed_queries.py
test/typing/plain_files/sql/core_ddl.py
test/typing/plain_files/sql/sql_operations.py
tools/format_docs_code.py
tools/generate_proxy_methods.py
tools/trace_orm_adapter.py
tox.ini

index dfbc82115bdc33f8508e0d7e8d96bad6fbaffce7..db28b56728deace851fe19d6fad37e4d652ed00e 100644 (file)
@@ -2,7 +2,7 @@
 # See https://pre-commit.com/hooks.html for more hooks
 repos:
 -   repo: https://github.com/python/black
-    rev: 25.11.0
+    rev: 26.3.1
     hooks:
     -   id: black
 
@@ -39,4 +39,4 @@ repos:
         types: [rst]
         exclude: README.*
         additional_dependencies:
-            - black==25.9.0
+            - black==26.3.1
index 414291797a563327f59e99a72a8949f4214a4724..7969c86c7bf4b9ec65155a6b4898bfafbe671536 100644 (file)
@@ -209,7 +209,6 @@ Given the example program below::
     from sqlalchemy import select
     from sqlalchemy import table
 
-
     engine = create_engine("sqlite://")
 
     engine.execute("CREATE TABLE foo (id integer)")
@@ -278,7 +277,6 @@ as a bonus our program is much clearer::
     from sqlalchemy import table
     from sqlalchemy import text
 
-
     engine = create_engine("sqlite://")
 
     # don't rely on autocommit for DML and DDL
@@ -1245,7 +1243,6 @@ Code that works with classical mappings should change imports and code from::
 
     from sqlalchemy.orm import mapper
 
-
     mapper(SomeClass, some_table, properties={"related": relationship(SomeRelatedClass)})
 
 To work from a central :class:`_orm.registry` object::
index cad79fa8a44d86f6cdd9dae7f016b23838a80fe7..a8affc0a56a2e41fe56436d26a219e45d1c7b943 100644 (file)
@@ -295,6 +295,7 @@ to as great a degree as possible.
 
 Setting Isolation Level or DBAPI Autocommit for a Connection
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+..format: off
 
 For an individual :class:`_engine.Connection` object that's acquired from
 :meth:`.Engine.connect`, the isolation level can be set for the duration of
@@ -313,6 +314,7 @@ are strings which are typically a subset of the following names::
 
 Not every DBAPI supports every value; if an unsupported value is used for a
 certain backend, an error is raised.
+..format: on
 
 For example, to force REPEATABLE READ on a specific connection, then
 begin a transaction::
@@ -2638,7 +2640,6 @@ the need for separate installation.   Use the ``register()`` function as follows
 
     from sqlalchemy.dialects import registry
 
-
     registry.register("mysql.foodialect", "myapp.dialect", "MyMySQLDialect")
 
 The above will respond to ``create_engine("mysql+foodialect://")`` and load the
index e09fda4a2722c7600a8572f184de5d9a62410d3f..632230b994946c4fa0d3848810aae98fa6c122ee 100644 (file)
@@ -161,7 +161,6 @@ datatype::
     from sqlalchemy.dialects.postgresql import UUID
     from sqlalchemy.orm import declarative_base
 
-
     Base = declarative_base()
 
 
index 532092ac9a5129cd12ef25f7de42d2414432cf44..bd0b0372b1f730a3c0b7ed75c6c11173c5516ea4 100644 (file)
@@ -102,7 +102,6 @@ decorator is supported::
     from sqlalchemy.orm import mapped_column
     from sqlalchemy.orm import registry
 
-
     reg = registry()
 
 
@@ -121,7 +120,6 @@ have better compatibility with some versions of the mypy type checker::
     from sqlalchemy.orm import mapped_column
     from sqlalchemy.orm import registry
 
-
     reg = registry()
 
 
@@ -172,7 +170,6 @@ the decorator directly::
     from sqlalchemy.orm import Mapped
     from sqlalchemy.orm import mapped_column
 
-
     reg = registry()
 
 
index e4e7ca5cf61cadc38691798291afc20a8e780d1b..44471c9aace142aa3fd37472646b2b4b4f24325e 100644 (file)
@@ -1088,7 +1088,6 @@ and ``required_name`` which is a :class:`.String` of length 30 that's
     from sqlalchemy import String
     from sqlalchemy.orm import mapped_column
 
-
     intpk = Annotated[int, mapped_column(primary_key=True)]
     timestamp = Annotated[
         datetime.datetime,
@@ -2045,7 +2044,6 @@ map such a table as in the following example::
     from sqlalchemy import UniqueConstraint
     from sqlalchemy.orm import DeclarativeBase
 
-
     metadata = MetaData()
     group_users = Table(
         "group_users",
index 5994fc765e75c9ac18ebe0c1914580c485f845d8..008d08507d6d3f2bf8cf5ed3233bec9a81c7f2ae 100644 (file)
@@ -15,7 +15,6 @@ from sqlalchemy import String
 from sqlalchemy import Table
 from sqlalchemy.ext.asyncio import create_async_engine
 
-
 meta = MetaData()
 
 t1 = Table(
index da22ee3276cff9036329f2a896e5f7379e640b17..c87f3a62a5a6f858e7bb3d9c3e74431838b55c79 100644 (file)
@@ -26,7 +26,6 @@ from sqlalchemy.orm.attributes import get_attribute
 from sqlalchemy.orm.attributes import set_attribute
 from sqlalchemy.orm.instrumentation import is_instrumented
 
-
 registry = _reg()
 
 
index 4962826280a047c510f92cc97889f5b3315c41f2..049b64a65da57d20310ca564d64cbb8606e3b763 100644 (file)
@@ -14,7 +14,6 @@ from sqlalchemy.orm import scoped_session
 from sqlalchemy.orm import sessionmaker
 from . import caching_query
 
-
 # dogpile cache regions.  A home base for cache configurations.
 regions = {}
 
index df1c2a318ef6e2eb7747e40ea44dd2a490688a69..882c86ab3bcdddd990b6cadb0d036fe6b81c04ed 100644 (file)
@@ -6,7 +6,6 @@ from .environment import cache
 from .environment import Session
 from .model import Person
 
-
 # load Person objects.  cache the result in the "default" cache region
 print("loading people....")
 people = Session.scalars(select(Person).options(FromCache("default"))).all()
index a5b654b06c85a4ffbfafbcf835e081cfa9f50c01..37c519ba74fef687ed61fced0322dbf728cf1f0d 100644 (file)
@@ -16,7 +16,6 @@ from .environment import Session
 from .model import cache_address_bits
 from .model import Person
 
-
 for p in Session.scalars(
     select(Person).options(joinedload(Person.addresses), cache_address_bits)
 ).unique():
index d6611eaa79d0031d9fb9e9e33dc362595cbf71ca..b40dbe39dfa9dc8d00bad14eb1483e355eb2a222 100644 (file)
@@ -8,7 +8,6 @@ from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy.orm import relationship
 from sqlalchemy.orm import sessionmaker
 
-
 Base = declarative_base()
 
 
index e718e2fc350881e0d5ef7501300041a1ddfdded7..60b4c254d8db10647957c04f96ca441d764f8a28 100644 (file)
@@ -17,7 +17,6 @@ from sqlalchemy.orm import relationship
 from sqlalchemy.orm import Session
 from sqlalchemy.orm import with_polymorphic
 
-
 intpk = Annotated[int, mapped_column(primary_key=True)]
 str50 = Annotated[str, mapped_column(String(50))]
 
index c2ba6942cc85d560a9999fc9a30d03131440aeba..e2a6608d1191b48c4d722739f87dcd4f9c0c87e2 100644 (file)
@@ -16,7 +16,6 @@ from sqlalchemy.orm import relationship
 from sqlalchemy.orm import Session
 from sqlalchemy.orm import with_polymorphic
 
-
 intpk = Annotated[int, mapped_column(primary_key=True)]
 str50 = Annotated[str, mapped_column(String(50))]
 
index 19d3ed491c125f7a21767ea00fca4d90c1997ee2..fdb206f2df639e7bed7cf6612e0bae77c47cecd5 100644 (file)
@@ -41,7 +41,6 @@ from sqlalchemy.orm import remote
 from sqlalchemy.orm import Session
 from sqlalchemy.sql.expression import cast
 
-
 Base = declarative_base()
 
 
index 1492f6abd89766b792488afee7ddd9d0eec55ed5..f34b99e7c7589ce01b03cc941cedc8d571fdc722 100644 (file)
@@ -16,7 +16,6 @@ from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy.orm import aliased
 from sqlalchemy.orm import Session
 
-
 Base = declarative_base()
 
 
index aeb124e1d1f553e3f90fa1bf32337b6d320eef9f..945458651a73e9e1aef498a375c446637d29c381 100644 (file)
@@ -2,6 +2,5 @@
 
 from . import Profiler
 
-
 if __name__ == "__main__":
     Profiler.main()
index de5e6dc27dae9157786f2602c7f23fe289353cc4..345d1e066f1b1bdbe673eab4f971562d3b701e6c 100644 (file)
@@ -13,7 +13,6 @@ from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy.orm import Session
 from . import Profiler
 
-
 Base = declarative_base()
 engine = None
 
index 36171411276502805d1b5dbd4c7cf56d67635231..4ec8822d829601fffb9f5dab713fad28d459343b 100644 (file)
@@ -24,7 +24,6 @@ from sqlalchemy.orm import Bundle
 from sqlalchemy.orm import Session
 from . import Profiler
 
-
 Base = declarative_base()
 engine = None
 
index 6ff187bf0f9efd0c7712c6f34fb21b887fa18c09..403316d4e43f269d65a2f15dc51b86ea18932793 100644 (file)
@@ -19,7 +19,6 @@ from sqlalchemy.orm import deferred
 from sqlalchemy.orm import Session
 from . import Profiler
 
-
 Base = declarative_base()
 engine = None
 
index 4b8132c50af9f46a32acea62d3f587435daaac76..d6c38c22ba0cc416703354f5165430efbe28c9b4 100644 (file)
@@ -16,7 +16,6 @@ from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy.orm import Session
 from . import Profiler
 
-
 Base = declarative_base()
 engine = None
 
index a63b0fcaaaef66c46040255e121626d7e4774253..09047f2fc0bd45bdb8725c169e8236c375e492ad 100644 (file)
@@ -32,7 +32,6 @@ from sqlalchemy.orm import relationship
 from sqlalchemy.sql import operators
 from sqlalchemy.sql import visitors
 
-
 echo = True
 db1 = create_async_engine("sqlite+aiosqlite://", echo=echo)
 db2 = create_async_engine("sqlite+aiosqlite://", echo=echo)
index 9a700734c510db15dfc17aeb33ed806b662b3b46..b327b2e15cfa65e5553106f4be3538bdaefd5510 100644 (file)
@@ -21,7 +21,6 @@ from sqlalchemy.orm import sessionmaker
 from sqlalchemy.sql import operators
 from sqlalchemy.sql import visitors
 
-
 echo = True
 db1 = create_engine("sqlite://", echo=echo)
 db2 = create_engine("sqlite://", echo=echo)
index fd754356e5d607f2ee67d4083e83dcf16711bd2c..e8683bfe857d2c7aa73f67bca5752fc42b081831 100644 (file)
@@ -22,7 +22,6 @@ from sqlalchemy.orm import mapped_column
 from sqlalchemy.orm import relationship
 from sqlalchemy.orm import sessionmaker
 
-
 echo = True
 engine = create_engine("sqlite://", echo=echo)
 
index 5ad59db8f3aec14ff5bca9e3cf42be39b8985b02..1029db8e9a5c85b59c2e1a2692213cf0093a5ae4 100644 (file)
@@ -18,7 +18,6 @@ from sqlalchemy.orm import joinedload
 from sqlalchemy.orm import relationship
 from sqlalchemy.orm import Session
 
-
 logging.basicConfig(
     filename="space_invaders.log",
     format="%(asctime)s,%(msecs)03d %(levelname)-5.5s %(message)s",
index e4c45b950806c0bfa095f0a134cf28b979b3132e..4bd1d6d8d0dcaac6399294015113a3307ce83f3a 100644 (file)
@@ -25,7 +25,6 @@ from sqlalchemy.orm import relationship
 from sqlalchemy.orm import Session
 from sqlalchemy.orm import with_loader_criteria
 
-
 Base = declarative_base()
 
 # this will be the current time as the test runs
index ccc1c77b4480e753c91c54da9de1e53ee2be8615..44df0a9c47a695499bd179dd5a3efdfa933ceece 100644 (file)
@@ -20,7 +20,6 @@ from .. import util
 from ..util.concurrency import await_fallback
 from ..util.concurrency import await_only
 
-
 if TYPE_CHECKING:
     from ..engine.interfaces import ConnectArgsType
     from ..engine.url import URL
index bf9b67a0a0652dbb1fc974aa8ed677fbe04b9f10..aef755d18e28861421567db28095a18a67bc2ae0 100644 (file)
@@ -18,7 +18,6 @@ from ..sql.schema import Column
 from ..sql.schema import ColumnCollectionConstraint
 from ..sql.schema import Index
 
-
 _OnConflictConstraintT = Union[str, ColumnCollectionConstraint, Index, None]
 _OnConflictIndexElementsT = Optional[
     Iterable[Union[Column[Any], str, roles.DDLConstraintColumnRole]]
index 68d1d7c744e4cd04446d81c14efe873503d740e0..ababcc138ff693c9ae8b45c4b10a6f98c1f9c096 100644 (file)
@@ -45,7 +45,6 @@ from .base import VARCHAR
 from .base import XML
 from ...sql import try_cast
 
-
 base.dialect = dialect = pyodbc.dialect
 
 
index fd1dd997c933231dba48599863c16e96297fe04c..9d718b057a8541d49bb5f900e4b5d41147773337 100644 (file)
@@ -3220,8 +3220,7 @@ class MSDialect(default.DefaultDialect):
 
             view_name = f"sys.{row[0]}"
 
-            cursor.execute(
-                """
+            cursor.execute("""
                     SELECT CASE transaction_isolation_level
                     WHEN 0 THEN NULL
                     WHEN 1 THEN 'READ UNCOMMITTED'
@@ -3232,10 +3231,7 @@ class MSDialect(default.DefaultDialect):
                     AS TRANSACTION_ISOLATION_LEVEL
                     FROM {}
                     where session_id = @@SPID
-                """.format(
-                    view_name
-                )
-            )
+                """.format(view_name))
         except self.dbapi.Error as err:
             raise NotImplementedError(
                 "Can't fetch isolation level;  encountered error {} when "
@@ -3432,8 +3428,7 @@ class MSDialect(default.DefaultDialect):
             else "NULL as filter_definition"
         )
         rp = connection.execution_options(future_result=True).execute(
-            sql.text(
-                f"""
+            sql.text(f"""
 select
     ind.index_id,
     ind.is_unique,
@@ -3453,8 +3448,7 @@ where
     and ind.type != 0
 order by
     ind.name
-                """
-            )
+                """)
             .bindparams(
                 sql.bindparam("tabname", tablename, ischema.CoerceUnicode()),
                 sql.bindparam("schname", owner, ischema.CoerceUnicode()),
@@ -3482,8 +3476,7 @@ order by
                 do["mssql_where"] = row["filter_definition"]
 
         rp = connection.execution_options(future_result=True).execute(
-            sql.text(
-                """
+            sql.text("""
 select
     ind_col.index_id,
     col.name,
@@ -3503,8 +3496,7 @@ where
 order by
     ind_col.index_id,
     ind_col.key_ordinal
-            """
-            )
+            """)
             .bindparams(
                 sql.bindparam("tabname", tablename, ischema.CoerceUnicode()),
                 sql.bindparam("schname", owner, ischema.CoerceUnicode()),
@@ -3930,8 +3922,7 @@ order by
     ):
         # Foreign key constraints
         s = (
-            text(
-                """\
+            text("""\
 WITH fk_info AS (
     SELECT
         ischema_ref_con.constraint_schema,
@@ -4031,8 +4022,7 @@ index_info AS (
 
     ORDER BY fk_info.constraint_schema, fk_info.constraint_name,
         fk_info.ordinal_position
-"""
-            )
+""")
             .bindparams(
                 sql.bindparam("tablename", tablename, ischema.CoerceUnicode()),
                 sql.bindparam("owner", owner, ischema.CoerceUnicode()),
index d739d7182392150ddcdc5138e33b97cbff7dd453..5249f3e39f0f46d192ab58ece983a01bee193e9d 100644 (file)
@@ -20,7 +20,6 @@ from ...types import String
 from ...types import TypeDecorator
 from ...types import Unicode
 
-
 ischema = MetaData()
 
 
index 7244bb0d3e30caab16b14495731835ae15e3c6ba..6c6c3a2e7457a2e781b786310e0a201dd0d706ff 100644 (file)
@@ -22,6 +22,7 @@ pymssql is a Python module that provides a Python DBAPI interface around
 
 
 """  # noqa
+
 import re
 
 from .base import MSDialect
index 5d3ae0b13f05d9a0e25e1aaa025f9cb752d67e52..874cc70a4e92210c685684d94b074395d63700f0 100644 (file)
@@ -359,7 +359,6 @@ hook. See that method for usage examples.
 
 """  # noqa
 
-
 import datetime
 import decimal
 import re
index 7e68c61dac831c29fa6ba71b7d0229a034a11c09..55ef60796c648e9dc39cc74b978682f719651676 100644 (file)
@@ -28,6 +28,7 @@ This dialect should normally be used only with the
     )
 
 """  # noqa
+
 from __future__ import annotations
 
 from types import ModuleType
index 575747617520523766e594d5e35047499887c728..0006eec5b5872bfbaf3ef890f71785c7e93ad4c8 100644 (file)
@@ -26,6 +26,7 @@ This dialect should normally be used only with the
     )
 
 """  # noqa
+
 from __future__ import annotations
 
 from types import ModuleType
index 3c84e36fd38266dcab824e54cfd9bc0d12a4c73a..506f2f2840c2fb184fa45ca20fda47e78f1b1822 100644 (file)
@@ -1063,6 +1063,7 @@ output:
     )
 
 """  # noqa
+
 from __future__ import annotations
 
 from collections import defaultdict
@@ -3254,7 +3255,7 @@ class MySQLDialect(default.DefaultDialect):
     def _is_mariadb_102(self) -> bool:
         return (
             self.is_mariadb
-            and self._mariadb_normalized_version_info  # type:ignore[operator]
+            and self._mariadb_normalized_version_info  # type: ignore[operator]
             > (
                 10,
                 2,
index 325d3321e37248e28ad2060553271aca053b71cf..cc3c2a8bc8db6137e285dd945f9c43da71715e67 100644 (file)
@@ -20,6 +20,7 @@ r"""
     dialects are mysqlclient and PyMySQL.
 
 """  # noqa
+
 from __future__ import annotations
 
 from typing import Any
index d5bbf14bb8c7a0ebbd55d25cc02d8c1a8ca323c8..b76041226f156e81fe3f3687b20fc1b681db69c0 100644 (file)
@@ -28,7 +28,6 @@ from ...sql.expression import alias
 from ...sql.selectable import NamedFromClause
 from ...util.typing import Self
 
-
 __all__ = ("Insert", "insert")
 
 
index bd5d7a25844cdeee1ac43990d73a51f9836574eb..5e78da4056c7f7cbfcc040953247bd20555d4f80 100644 (file)
@@ -27,6 +27,7 @@ be ``mysqldb``. ``mariadb+mariadbconnector://`` is required to use this driver.
 .. mariadb: https://github.com/mariadb-corporation/mariadb-connector-python
 
 """  # noqa
+
 from __future__ import annotations
 
 import re
index d97dbe2195c4de43dfefdebd8acf889c4e4b0991..1cc0c9e08d9ad81f4fb2eefe2b39055d614418b9 100644 (file)
@@ -45,6 +45,7 @@ charset/collation will allow connectivity.
 
 
 """  # noqa
+
 from __future__ import annotations
 
 import re
@@ -110,8 +111,8 @@ class IdentifierPreparerCommon_mysqlconnector:
 
     def _escape_identifier(self, value: str) -> str:
         value = value.replace(
-            self.escape_quote,  # type:ignore[attr-defined]
-            self.escape_to_quote,  # type:ignore[attr-defined]
+            self.escape_quote,  # type: ignore[attr-defined]
+            self.escape_to_quote,  # type: ignore[attr-defined]
         )
         return value
 
index 188668be7942a6ae7e8b743cdd08615b261a2989..60fa3821db7a997dcd0b6495dd1b598ec8ffb04c 100644 (file)
@@ -84,6 +84,7 @@ Server Side Cursors
 The mysqldb dialect supports server-side cursors. See :ref:`mysql_ss_cursors`.
 
 """
+
 from __future__ import annotations
 
 import re
index ae86938e6586a502ba1012c756f9d7e78efd0789..e297da254fb2c2c1da3cea5d06e0432124cdc802 100644 (file)
@@ -47,6 +47,7 @@ and targets 100% compatibility.   Most behavioral notes for MySQL-python apply
 to the pymysql driver as well.
 
 """  # noqa
+
 from __future__ import annotations
 
 from typing import Any
index bb37ff0e590de9ab07ab6b73e30f7e08fcdcb708..023c17682f3ca8f07d58d5bf91f32aa5aa9e9149 100644 (file)
@@ -42,6 +42,7 @@ Pass through exact pyodbc connection string::
     connection_uri = "mysql+pyodbc:///?odbc_connect=%s" % params
 
 """  # noqa
+
 from __future__ import annotations
 
 import datetime
index df0b88ebb0761e0b37180f37da46e9551071afd5..0ceda89f2afb99a7b03e013ff3ff8be04126f775 100644 (file)
@@ -371,7 +371,7 @@ class MySQLTableDefinitionParser:
 
         buffer = []
         for row in columns:
-            (name, col_type, nullable, default, extra) = (
+            name, col_type, nullable, default, extra = (
                 row[i] for i in (0, 1, 2, 4, 5)
             )
 
index 8750354c9afa1b265d8ed35b13690447d62c01e6..2dc823d47d916310f37db68ad93395037ecf2658 100644 (file)
@@ -489,6 +489,7 @@ SQLAlchemy type (or a subclass of such).
    as better integration of outputtypehandlers.
 
 """  # noqa
+
 from __future__ import annotations
 
 import decimal
index a41f6be87f83b170bfbcbee1be032a229cceeb7b..abe8e571fd7d09a09f1fcbcc60dfd5ca9abf8afc 100644 (file)
@@ -588,6 +588,7 @@ SQLAlchemy type (or a subclass of such).
 .. versionadded:: 2.0.0 added support for the python-oracledb driver.
 
 """  # noqa
+
 from __future__ import annotations
 
 import collections
index 53057675baecf81d2858725a3c8cd330e3a50536..ac1c9b0401fc86d635075f42d0bf5380f297d67b 100644 (file)
@@ -313,12 +313,10 @@ class VECTOR(types.TypeEngine):
                 )
 
             else:
-                raise TypeError(
-                    """
+                raise TypeError("""
                     Invalid input for VECTOR: expected a list, an array.array,
                     or a SparseVector object.
-                    """
-                )
+                    """)
 
         return process
 
index a94cfef2c6e3d83b5ea4e4727d79d538f595ae6c..e1900ec9bd05ff48d282cf0bc893ddd1d8121cb1 100644 (file)
@@ -89,7 +89,6 @@ from .types import TIMESTAMP
 from .types import TSQUERY
 from .types import TSVECTOR
 
-
 # Alias psycopg also as psycopg_async
 psycopg_async = type(
     "psycopg_async", (ModuleType,), {"dialect": psycopg.dialect_async}
index 053770e1c89375c4827367be0841035d46b4987e..6eea13179d2d554320fff9b4242cc0060099c190 100644 (file)
@@ -35,7 +35,6 @@ from ...sql.elements import TextClause
 from ...sql.expression import alias
 from ...util.typing import Self
 
-
 __all__ = ("Insert", "insert")
 
 
index 27005f06391a7b4e206cd1857aa6c4841a4177bf..66ad484257edb982c0c01d04a6c2510bca33e551 100644 (file)
@@ -19,7 +19,6 @@ from .operators import HAS_KEY
 from ... import types as sqltypes
 from ...sql import functions as sqlfunc
 
-
 __all__ = ("HSTORE", "hstore")
 
 
index 9e4d26570e541f3efba330c3ebb63aac5d77c60a..d38d0160b4ff4d5a313aa408119a2c8ad10d6fa6 100644 (file)
@@ -7,7 +7,6 @@
 # mypy: ignore-errors
 from ...sql import operators
 
-
 _getitem_precedence = operators._PRECEDENCE[operators.json_getitem_op]
 _eq_precedence = operators._PRECEDENCE[operators.eq]
 
index cd233de1356f7b9e5b96c8d78b33934efeb1609b..faee3414fd2799f2afbded930daa52af5ac51261 100644 (file)
@@ -95,6 +95,7 @@ of the :ref:`psycopg2 <psycopg2_isolation_level>` dialect:
 
 
 """  # noqa
+
 import decimal
 import re
 
@@ -587,11 +588,8 @@ class PGDialect_pg8000(PGDialect):
 
     def _set_client_encoding(self, dbapi_connection, client_encoding):
         cursor = dbapi_connection.cursor()
-        cursor.execute(
-            f"""SET CLIENT_ENCODING TO '{
-                client_encoding.replace("'", "''")
-            }'"""
-        )
+        cursor.execute(f"""
+            SET CLIENT_ENCODING TO '{client_encoding.replace("'", "''")}'""")
         cursor.execute("COMMIT")
         cursor.close()
 
index 4af214dabbb66c5a4e5a7b0e5011e3b8f08814f1..4b8d4e8ee98e23971e9227a8040e0b790763d03f 100644 (file)
@@ -168,6 +168,7 @@ specified::
     `Client-side-binding cursors <https://www.psycopg.org/psycopg3/docs/advanced/cursors.html#client-side-binding-cursors>`_
 
 """  # noqa
+
 from __future__ import annotations
 
 from collections import deque
index 48ed9bf1e136f01ec52bc0b860b88dbb367cc0be..e56eb6d6dafca2478a12df88eabd0efe23c7c93e 100644 (file)
@@ -488,6 +488,7 @@ place within SQLAlchemy's own marshalling logic, and not that of ``psycopg2``
 which may be more performant.
 
 """  # noqa
+
 from __future__ import annotations
 
 import collections.abc as collections_abc
index f4dcfc7014a56659801cb4d00e18b206970a093d..cfad97a69c280714c3a75993616800995fa57dc7 100644 (file)
@@ -22,6 +22,7 @@ is as per ``psycopg2``.
     :mod:`sqlalchemy.dialects.postgresql.psycopg2`
 
 """  # noqa
+
 from .psycopg2 import PGDialect_psycopg2
 from ... import util
 
index afd3688edcdeabad7eaecc858da9f9f07040d79b..4cb4a2c3190958f8d5b7f46928fa41dba5c454e1 100644 (file)
@@ -77,6 +77,7 @@ based on the kind of SQLite database that's requested:
     :paramref:`_sa.create_engine.poolclass` parameter.
 
 """  # noqa
+
 from __future__ import annotations
 
 import asyncio
index d9f5756755367028b6f466eac1e6da86e0dbaad9..be388a51463524d29765e60fd0a9dfbd03da9908 100644 (file)
@@ -847,13 +847,11 @@ The bug, entirely outside of SQLAlchemy, can be illustrated thusly::
     cursor.execute("select x.a, x.b from x")
     assert [c[0] for c in cursor.description] == ["a", "b"]
 
-    cursor.execute(
-        """
+    cursor.execute("""
         select x.a, x.b from x where a=1
         union
         select x.a, x.b from x where a=2
-        """
-    )
+        """)
     assert [c[0] for c in cursor.description] == ["a", "b"], [
         c[0] for c in cursor.description
     ]
@@ -888,13 +886,11 @@ to filter these out::
     result = conn.exec_driver_sql("select x.a, x.b from x")
     assert result.keys() == ["a", "b"]
 
-    result = conn.exec_driver_sql(
-        """
+    result = conn.exec_driver_sql("""
         select x.a, x.b from x where a=1
         union
         select x.a, x.b from x where a=2
-        """
-    )
+        """)
     assert result.keys() == ["a", "b"]
 
 Note that above, even though SQLAlchemy filters out the dots, *both
@@ -987,6 +983,7 @@ passed to methods such as :meth:`_schema.MetaData.reflect` or
     documentation.
 
 '''  # noqa
+
 from __future__ import annotations
 
 import datetime
@@ -2582,7 +2579,7 @@ class SQLiteDialect(default.DefaultDialect):
         fks = {}
 
         for row in pragma_fks:
-            (numerical_id, rtbl, lcol, rcol) = (row[0], row[2], row[3], row[4])
+            numerical_id, rtbl, lcol, rcol = (row[0], row[2], row[3], row[4])
 
             if not rcol:
                 # no referred column, which means it was not named in the
index d2e84466c9d5c41896e1b5e5fa723f0dd54118b6..54fa940a776493b3d843a87911899aaf05efd638 100644 (file)
@@ -392,6 +392,7 @@ connection when it is created. That is accomplished with an event listener::
             print(conn.scalar(text("SELECT UDF()")))
 
 """  # noqa
+
 from __future__ import annotations
 
 import math
index 7b1d6b0db2870d7b6dd7450e384330694a836305..11c7ef01c5c2c9da7bb36718a002b2a1fd802ae8 100644 (file)
@@ -28,7 +28,6 @@ from typing import Type
 from typing import TypeVar
 from typing import Union
 
-
 _DT = TypeVar(
     "_DT", bound=Union[datetime.datetime, datetime.time, datetime.date]
 )
index e3b71fe5b53fa6334d752814080ab2fdc78706f4..af313b878247cebdec463784f79eba87f8ca2660 100644 (file)
@@ -5,6 +5,7 @@
 # This module is part of SQLAlchemy and is released under
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
 """Defines :class:`_engine.Connection` and :class:`_engine.Engine`."""
+
 from __future__ import annotations
 
 import contextlib
index 9ab94763b0ad384bea4abcd14c87cddcbdaca9eb..dee77dab43349d71fe884bdc6a66825a19ffa7ee 100644 (file)
@@ -630,7 +630,7 @@ def create_engine(url: Union[str, _url.URL], **kwargs: Any) -> Engine:
     dialect = dialect_cls(**dialect_args)
 
     # assemble connection arguments
-    (cargs_tup, _cparams) = dialect.create_connect_args(u)
+    cargs_tup, _cparams = dialect.create_connect_args(u)
     cparams = util.immutabledict(_cparams).union(pop_kwarg("connect_args", {}))
 
     if "async_fallback" in cparams and util.asbool(cparams["async_fallback"]):
index 5da66febb156dea57297022deded7a7c5e6a5987..15ae1d0c74e7e8b57f086c3a21435d30a726cc30 100644 (file)
@@ -8,7 +8,6 @@
 """Define cursor-specific result set constructs including
 :class:`.CursorResult`."""
 
-
 from __future__ import annotations
 
 import collections
@@ -56,7 +55,6 @@ from ..util.typing import Final
 from ..util.typing import Literal
 from ..util.typing import Self
 
-
 if typing.TYPE_CHECKING:
     from .base import Connection
     from .default import DefaultExecutionContext
index a5173b9d7d041f06d2bda3a7360c9834b2e0fb34..adcf6eb367938db36db03331195987207ec06270 100644 (file)
@@ -19,7 +19,6 @@ from typing import Union
 from . import url as _url
 from .. import util
 
-
 if typing.TYPE_CHECKING:
     from .base import Engine
     from .interfaces import _CoreAnyExecuteParams
index 0888257f20fe473c3c493923ae85d804c29c00da..aa854aa699f1b73b1329379a9f372befade03333 100644 (file)
@@ -12,6 +12,7 @@ processors.
 They all share one common characteristic: None is passed through unchanged.
 
 """
+
 from __future__ import annotations
 
 import typing
index c976ae0f1385d3233439ebf50c832e3c678365df..b3659acf9abcbec410d988e6340f349e3b136a72 100644 (file)
@@ -24,6 +24,7 @@ methods such as get_table_names, get_columns, etc.
    use the key 'name'. So for most return values, each record will have a
    'name' attribute..
 """
+
 from __future__ import annotations
 
 import contextlib
index 38b2716b88b612e47706a636f2d13cfae355a4de..2f8547df51e4790fcb82347614ae5b03dddae845 100644 (file)
@@ -6,6 +6,7 @@
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
 
 """Public API functions for the event system."""
+
 from __future__ import annotations
 
 from typing import Any
@@ -18,7 +19,6 @@ from .registry import _ListenerFnType
 from .. import exc
 from .. import util
 
-
 CANCEL = util.symbol("CANCEL")
 NO_RETVAL = util.symbol("NO_RETVAL")
 
index e09cb4d5a4a5b817c58b6c91cc84e592d5ad1763..2727bfaa572dcb52564004acec71f9fa43762b69 100644 (file)
@@ -28,6 +28,7 @@ as well as support for subclass propagation (e.g. events assigned to
 ``Pool`` vs. ``QueuePool``) are all implemented here.
 
 """
+
 from __future__ import annotations
 
 import collections
index 9f6e410d683c49b4f525b9502fcdba92dd7a35aa..239e4d7614c06b593423c1aa700d210502ce7008 100644 (file)
@@ -15,6 +15,7 @@ at the class level of a particular ``_Dispatch`` class as well as within
 instances of ``_Dispatch``.
 
 """
+
 from __future__ import annotations
 
 import typing
index 63fc1ee9a9aad598e3703b8e22b43e8d0c474f4a..b2fc4ca701ab43e22de308fdc03e929a59c4789d 100644 (file)
@@ -9,6 +9,7 @@
 generation of deprecation notes and docstrings.
 
 """
+
 from __future__ import annotations
 
 import typing
index 22be5628e44991d1468002b07f79faa1dd8e61de..a6b07c24b7181c2c146ca0435347da82dda06c4c 100644 (file)
@@ -14,6 +14,7 @@ membership in all those collections can be revoked at once, based on
 an equivalent :class:`._EventKey`.
 
 """
+
 from __future__ import annotations
 
 import collections
index c31c16b4dcdb3420e0b2aa69833676f668115a60..ed928eaab30fb494c9f809d3153576c9b75feef7 100644 (file)
@@ -12,6 +12,7 @@ raised as a result of DBAPI exceptions are all subclasses of
 :exc:`.DBAPIError`.
 
 """
+
 from __future__ import annotations
 
 import typing
index 5d61ac7652e624cf16d63e7797c041afef357912..a72b4aec5ec78a7217b176ccb264119ab61f0399 100644 (file)
@@ -7,5 +7,4 @@
 
 from .. import util as _sa_util
 
-
 _sa_util.preloaded.import_prefix("sqlalchemy.ext")
index 5fbabe578cc2830820884ea79e62af3cd6ed7dbd..c1f0cc8bb303681f2a8bff4ff2838663c448e14b 100644 (file)
@@ -13,6 +13,7 @@ transparent proxied access to the endpoint of an association object.
 See the example ``examples/association/proxied_association.py``.
 
 """
+
 from __future__ import annotations
 
 import operator
index 263bd75cf43dd36a4ec15898e353fd3e8aa79633..57d6fcc6f4798de6a533eba7444f0536c5f82dd4 100644 (file)
@@ -187,7 +187,7 @@ class AsyncConnectable:
     ],
 )
 # "Class has incompatible disjoint bases" - no idea
-class AsyncConnection(  # type:ignore[misc]
+class AsyncConnection(  # type: ignore[misc]
     ProxyComparable[Connection],
     StartableContext["AsyncConnection"],
     AsyncConnectable,
index c547b9781e5f91ab66ce51a16415e5449acebaa5..003954b4a731ba87939967c8c7267d1e6dd489e6 100644 (file)
@@ -41,7 +41,6 @@ from ...util.concurrency import greenlet_spawn
 from ...util.typing import Concatenate
 from ...util.typing import ParamSpec
 
-
 if TYPE_CHECKING:
     from .engine import AsyncConnection
     from .engine import AsyncEngine
index a810b82e8989d7df4446b04b5d57aba877647ee1..289ef1915e28cc39199a86dd3b839bc5067d7083 100644 (file)
@@ -710,6 +710,7 @@ be applied as::
 
 
 """  # noqa
+
 from __future__ import annotations
 
 import dataclasses
index 2377c7d12a55702f762f162ee8bc164674256000..da9acd14314cdb606b8cc7c4e40dabdef29c0517 100644 (file)
@@ -28,7 +28,6 @@ from ..sql import func
 from ..sql import literal_column
 from ..sql import util as sql_util
 
-
 log = logging.getLogger(__name__)
 
 
index 2de5001ee462bef6541a0f86e3f83302afce6af1..1c10ba423dedec1ea8faed32b035f7eaf475027e 100644 (file)
@@ -481,6 +481,7 @@ Example usage::
     )
 
 """
+
 from __future__ import annotations
 
 from typing import Any
index d119aaebe1ca6d06f6c0985e7bd6539b62cb6a73..d2a8d8b09d5e927e6254552bf56a8c4b25a6cfba 100644 (file)
@@ -8,6 +8,7 @@
 
 
 """Public API functions and helpers for declarative."""
+
 from __future__ import annotations
 
 import collections
index 4722353f3b1cd0aaaf99d309039e50a477b84eba..e0bb658f861bfc6985294943b7000659fc537e10 100644 (file)
@@ -23,6 +23,7 @@ the source distribution.
 
 
 """
+
 from __future__ import annotations
 
 from typing import Any
index 08d55dbdb753d80b3d1a44ff0a5eb789846790eb..79c83f8f4f57f5511e9c682cec0f9341f55b309d 100644 (file)
@@ -23,6 +23,7 @@ For examples of how the instrumentation extension is used,
 see the example :ref:`examples_instrumentation`.
 
 """
+
 import weakref
 
 from .. import util
@@ -39,7 +40,6 @@ from ..orm.instrumentation import _default_state_getter
 from ..orm.instrumentation import ClassManager
 from ..orm.instrumentation import InstrumentationFactory
 
-
 INSTRUMENTATION_MANAGER = "__sa_instrumentation_manager__"
 """Attribute, elects custom instrumentation when present on a mapped class.
 
index 73b0d6d26e701a3fb3fe807aed6dfdff89218c13..fe2ab07a6c1e142ef356fd0f51343630b034d4a1 100644 (file)
@@ -9,6 +9,7 @@
 Mypy plugin for SQLAlchemy ORM.
 
 """
+
 from __future__ import annotations
 
 from typing import Callable
index fcd483cf5fccbc597567c27396be06eb37f785e6..489a3eff248b76dee127bedd1646da4af446bcb7 100644 (file)
@@ -126,6 +126,7 @@ start numbering at 1 or some other integer, provide ``count_from=1``.
 
 
 """
+
 from __future__ import annotations
 
 from typing import Any
index 2fb022c349a7a2c1e082c747f8f0457fdc7d3bb4..92aae7aa7c7700db5a8f652ffeb7581b33252155 100644 (file)
@@ -82,7 +82,6 @@ from ..orm.session import Session
 from ..util import b64decode
 from ..util import b64encode
 
-
 __all__ = ["Serializer", "Deserializer", "dumps", "loads"]
 
 
index 3a06418649e585b1a2f4bd8ad83069dba3c84c71..dfe828f666c82b7f7bd7568e22a78550f9821e04 100644 (file)
@@ -10,6 +10,7 @@
 this module is legacy as 2.0 APIs are now standard.
 
 """
+
 from .engine import Connection as Connection
 from .engine import create_engine as create_engine
 from .engine import Engine as Engine
index c6380c7ca89875e192c2e9e91a3601c699085c80..21898c1f2e1ad47b413f0956b4de815a38d57e7b 100644 (file)
@@ -28,6 +28,7 @@ tools which build on top of SQLAlchemy configurations to be constructed
 in a forwards-compatible way.
 
 """
+
 from __future__ import annotations
 
 from typing import Any
index a1ede983107221933651c9f3a2588d394fe1b751..875a99c5846a5c71a4e2c20cfcd46be82e2bb687 100644 (file)
@@ -17,6 +17,7 @@ and :class:`_pool.Pool` objects, corresponds to a logger specific to that
 instance only.
 
 """
+
 from __future__ import annotations
 
 import logging
@@ -33,7 +34,6 @@ from .util import py311
 from .util import py38
 from .util.typing import Literal
 
-
 if py38:
     STACKLEVEL = True
     # needed as of py3.11.0b1
index 742ebfb0522a984417ccacec7521c0bb27c5ee98..01e6e6370f252197026c8b6ac78e9fa1ff603fac 100644 (file)
@@ -105,6 +105,7 @@ The owning object and :class:`.CollectionAttributeImpl` are also reachable
 through the adapter, allowing for some very sophisticated behavior.
 
 """
+
 from __future__ import annotations
 
 import operator
index 9acc59314a9004f6b76564061a8dc4d7bf9bca59..43e3bb4657c3a336042cd026c99d5eac8bae3ae8 100644 (file)
@@ -2565,7 +2565,7 @@ def _determine_last_joined_entity(
     if not setup_joins:
         return None
 
-    (target, onclause, from_, flags) = setup_joins[-1]
+    target, onclause, from_, flags = setup_joins[-1]
 
     if isinstance(
         target,
index 0019bcd68e1cf1ff69610072c01b7701c4d62e6a..f8613644325930766b0271bb5db5a97a256a35a8 100644 (file)
@@ -190,7 +190,7 @@ class DependencyProcessor:
                     if child_state not in uow.states:
                         child_action = (None, None)
                     else:
-                        (deleted, listonly) = uow.states[child_state]
+                        deleted, listonly = uow.states[child_state]
                         if deleted:
                             child_action = (
                                 unitofwork.DeleteState(uow, child_state),
index a493373e60ad545a59a979faa17dfd8ed0e934cb..460c4d9340224577bfa9eaf2fbcc7bed72b14bd4 100644 (file)
@@ -10,6 +10,7 @@ that exist as configurational elements, but don't participate
 as actively in the load/persist ORM loop.
 
 """
+
 from __future__ import annotations
 
 from dataclasses import is_dataclass
@@ -57,7 +58,6 @@ from ..util.typing import get_args
 from ..util.typing import is_fwd_ref
 from ..util.typing import is_pep593
 
-
 if typing.TYPE_CHECKING:
     from ._typing import _InstanceDict
     from ._typing import _RegistryType
index c13d1a25f06bb74889a9e169e702bae8cbe8c96d..2dc6b82be8a71cf9f69a2374d0d15fd254849188 100644 (file)
@@ -45,7 +45,6 @@ from .writeonly import WriteOnlyLoader
 from .. import util
 from ..engine import result
 
-
 if TYPE_CHECKING:
     from . import QueryableAttribute
     from .mapper import Mapper
index 392d726e990382fe1f7469d780e4bd057ce53295..9d4652f11329d0eecf526aa64127417cee2bd3e2 100644 (file)
@@ -16,7 +16,6 @@ This module is **private, for internal use by SQLAlchemy**.
 
 """
 
-
 from __future__ import annotations
 
 from typing import Type
index 2affb00028d11d0639756812a219510e46caeb36..ea4f16422e4d87abae02fa971db8bf79bae60358 100644 (file)
@@ -6,6 +6,7 @@
 # the MIT License: https://www.opensource.org/licenses/mit-license.php
 
 """ORM event interfaces."""
+
 from __future__ import annotations
 
 from typing import Any
index 7091d369b6ca8aefc350ccf4104bf034bb9c079e..59c145392660f3c09f158252e0664af7a8ef4c83 100644 (file)
@@ -30,7 +30,6 @@ alternate instrumentation forms.
 
 """
 
-
 from __future__ import annotations
 
 from typing import Any
index fb7efa76e0e52d7347480ea9fe3ebf5eb6f28a50..cfd1849785de64591f091e808769c71bce7e7ee6 100644 (file)
@@ -109,7 +109,7 @@ def instances(cursor: CursorResult[Any], context: QueryContext) -> Result[Any]:
     )
 
     try:
-        (process, labels, extra) = list(
+        process, labels, extra = list(
             zip(
                 *[
                     query_entity.row_processor(context, cursor)
@@ -561,7 +561,7 @@ def load_on_pk_identity(
     if primary_key_identity is not None:
         mapper = query._propagate_attrs["plugin_subject"]
 
-        (_get_clause, _get_params) = mapper._get_clause
+        _get_clause, _get_params = mapper._get_clause
 
         # None present in ident - turn those comparisons
         # into "IS NULL"
index 8ee0ac4fff13bc6a6993389b0de7a41093d96e08..a7c361a7e96dc7ed8bcd09e0c7bef2f167baa43f 100644 (file)
@@ -15,6 +15,7 @@ This is a semi-private module; the main configurational API of the ORM is
 available in :class:`~sqlalchemy.orm.`.
 
 """
+
 from __future__ import annotations
 
 from collections import deque
index 0b7a218ca8e14cd90bee324ecd53b68e25b4e63f..268065083197ac7b0b76dba147c9a02d4e7e0a8d 100644 (file)
@@ -15,6 +15,7 @@ The functions here are called only by the unit of work functions
 in unitofwork.py.
 
 """
+
 from __future__ import annotations
 
 from itertools import chain
index 65d3fcc3f1f58f8e7f4e1c4ba16e78eb17b2f31e..118b5158f065cd767187477659a071d844462d98 100644 (file)
@@ -912,10 +912,9 @@ class MappedColumn(
                         )
                     else:
                         detail = (
-                            f"""none of {
-                                ", ".join(f"'{t}'" for t in checks)
-                            } """
-                            "are resolvable by the registry"
+                            "none of "
+                            + ", ".join(f"'{t}'" for t in checks)
+                            + " are resolvable by the registry"
                         )
                     raise orm_exc.MappedAnnotationError(
                         "Could not locate SQLAlchemy Core type when resolving "
index 3c58430050d1f023efdc7c24010ca4a1a306d421..696b04276fe7e14d29845e3a7ac94a9e8e31d80f 100644 (file)
@@ -18,6 +18,7 @@ ORM session, whereas the ``Select`` construct interacts directly with the
 database to return iterable result sets.
 
 """
+
 from __future__ import annotations
 
 import collections.abc as collections_abc
@@ -95,7 +96,6 @@ from ..util.typing import Literal
 from ..util.typing import Self
 from ..util.typing import SupportsIndex
 
-
 if TYPE_CHECKING:
     from ._typing import _EntityType
     from ._typing import _ExternalEntityType
index 723a51ea2f43b52d5567039507d8a7c807ceafac..df0365f8e77a1b135d4fc9c80f12fcfff9b1aa03 100644 (file)
@@ -13,6 +13,7 @@ SQL annotation and aliasing behavior focused on the `primaryjoin`
 and `secondaryjoin` aspects of :func:`_orm.relationship`.
 
 """
+
 from __future__ import annotations
 
 import collections
index 72abbb46e4fb21f26608f7cf9e327b48b9811e7a..623ab00a022f15a3d6727146c6822884847358ae 100644 (file)
@@ -4810,7 +4810,7 @@ class Session(_SessionClassMethods, EventTarget):
             ) or not hasattr(attr.impl, "get_history"):
                 continue
 
-            (added, unchanged, deleted) = attr.impl.get_history(
+            added, unchanged, deleted = attr.impl.get_history(
                 state, dict_, passive=PassiveFlag.NO_CHANGE
             )
 
index c65b37e54c493db561241906456a1148dd4a159a..7de3b88316b121128991d7b6f20e800a84539fee 100644 (file)
@@ -30,7 +30,6 @@ from .. import event
 from .. import util
 from ..util import topological
 
-
 if TYPE_CHECKING:
     from .dependency import DependencyProcessor
     from .interfaces import MapperProperty
@@ -521,7 +520,7 @@ class Preprocess(IterateMappersMixin):
 
         for mapper in self._mappers(uow):
             for state in uow.mappers[mapper].difference(self.processed):
-                (isdelete, listonly) = uow.states[state]
+                isdelete, listonly = uow.states[state]
                 if not listonly:
                     if isdelete:
                         delete_states.add(state)
@@ -607,7 +606,7 @@ class ProcessAll(IterateMappersMixin, PostSortRec):
     def _elements(self, uow):
         for mapper in self._mappers(uow):
             for state in uow.mappers[mapper]:
-                (isdelete, listonly) = uow.states[state]
+                isdelete, listonly = uow.states[state]
                 if isdelete == self.isdelete and not listonly:
                     yield state
 
index f3a5c2dd8420bc3f73fb2457451d5f7781bd2764..758e7fdf5e4a83a720377a89d97e642fc2a1670a 100644 (file)
@@ -7,6 +7,7 @@
 
 
 """Pool implementation classes."""
+
 from __future__ import annotations
 
 import threading
index 39754a3c2d9bc818db282d0ccd54c8750ecf66d8..ead3a770c0d7f1379a62d6008d9e6c30697d418a 100644 (file)
@@ -11,7 +11,6 @@ are meaningful to the ORM.
 
 """
 
-
 from __future__ import annotations
 
 from ..util.typing import Literal
index c65e96c0db973eb5c470885f071f233f71a2b8f4..b5608efc14dc1e386a69d7377a8f186d6367fdd2 100644 (file)
@@ -32,7 +32,7 @@ class prefix_anon_map(Dict[str, str]):
     """
 
     def __missing__(self, key: str) -> str:
-        (ident, derived) = key.split(" ", 1)
+        ident, derived = key.split(" ", 1)
         anonymous_counter = self.get(derived, 1)
         self[derived] = anonymous_counter + 1  # type: ignore
         value = f"{derived}_{anonymous_counter}"
index 39772c9e76ff5efcbdf6050a0fc5bc6d24840f42..b5e6cbc14865d924964e8d30fb1022ebd75f77f9 100644 (file)
@@ -8,7 +8,6 @@
 
 """Foundational utilities common to many sql modules."""
 
-
 from __future__ import annotations
 
 import collections
index 5efc2326735c633e51702c860cc9acb3d23d7b80..02b40029de403fb5ba65a5dac4342ff97c00eda6 100644 (file)
@@ -23,6 +23,7 @@ To generate user-defined SQL strings, see
 :doc:`/ext/compiler`.
 
 """
+
 from __future__ import annotations
 
 import collections
@@ -2129,7 +2130,7 @@ class SQLCompiler(Compiled):
                     leep_res = self._literal_execute_expanding_parameter(
                         escaped_name, parameter, values
                     )
-                    (to_update, replacement_expr) = leep_res
+                    to_update, replacement_expr = leep_res
 
                     to_update_sets[escaped_name] = to_update
                     replacement_expressions[escaped_name] = replacement_expr
index d37274c8e08e9ebd31a257de9f2a893ccad4d3d3..80e90eb838b558fbe5ac1381e00dbcae39270ed1 100644 (file)
@@ -10,6 +10,7 @@
 within INSERT and UPDATE statements.
 
 """
+
 from __future__ import annotations
 
 import functools
@@ -848,7 +849,7 @@ def _setup_delete_return_defaults(
     toplevel,
     kw,
 ):
-    (_, _, implicit_return_defaults, *_) = _get_returning_modifiers(
+    _, _, implicit_return_defaults, *_ = _get_returning_modifiers(
         compiler, stmt, compile_state, toplevel
     )
 
index 636500ee8c3a0f90a1fe503887891afa1500eee7..eda87c221b202ead9717e1740aee8904654b1a69 100644 (file)
@@ -11,6 +11,7 @@ Provides the hierarchy of DDL-defining schema items as well as routines
 to invoke them for a create/drop call.
 
 """
+
 from __future__ import annotations
 
 import contextlib
index ac769648ab11b72a13dc3e4392dedba30584b356..ad4f0f57d3786043b993695da1711fdd9690f569 100644 (file)
@@ -9,6 +9,7 @@ Provide :class:`_expression.Insert`, :class:`_expression.Update` and
 :class:`_expression.Delete`.
 
 """
+
 from __future__ import annotations
 
 import collections.abc as collections_abc
index dcecb20c4e8124b923ad3899ee0e67aaf2d67212..6a9df124127a367cfe7976c8cb6d1a07abd5beaa 100644 (file)
@@ -80,7 +80,6 @@ from ..util.typing import Literal
 from ..util.typing import ParamSpec
 from ..util.typing import Self
 
-
 if typing.TYPE_CHECKING:
     from ._typing import _ByArgument
     from ._typing import _ColumnExpressionArgument
index b4a185a09cd87d248d9cf77476eceb654fcdc31b..b91376c4404f2bfa890208806c7dbee24e0e91e2 100644 (file)
@@ -7,7 +7,6 @@
 
 """Defines the public namespace for SQL expression constructs."""
 
-
 from __future__ import annotations
 
 from ._dml_constructors import delete as delete
index a9e94aec1360beb29a34b005023edbf7f9ba83aa..4d53240c5107205bb89b8f25992677fde6e4b793 100644 (file)
@@ -44,7 +44,6 @@ from .. import inspection
 from .. import util
 from ..util.typing import Literal
 
-
 if TYPE_CHECKING:
     from .elements import BindParameter
     from .elements import ClauseElement
@@ -301,7 +300,7 @@ class LambdaElement(elements.ClauseElement):
                 rec = lambda_element._rec
                 if rec.bindparam_trackers:
                     tracker_instrumented_fn = (
-                        rec.tracker_instrumented_fn  # type:ignore [union-attr] # noqa: E501
+                        rec.tracker_instrumented_fn  # type: ignore [union-attr] # noqa: E501
                     )
                     for tracker in rec.bindparam_trackers:
                         tracker(
index 7de91565f6828f0826cfc9456800f890bebe9902..b893bf7245cfbbd268e190bef9c6ea4f14a094c3 100644 (file)
@@ -28,6 +28,7 @@ Since these objects are part of the SQL expression language, they are usable
 as components in SQL expressions.
 
 """
+
 from __future__ import annotations
 
 from abc import ABC
@@ -2357,11 +2358,9 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]):
             if existing_col is not self:
                 if not allow_replacements:
                     raise exc.DuplicateColumnError(
-                        f"A column with {conflicts_on} "
-                        f"""'{
+                        f"A column with {conflicts_on} " f"""'{
                             self.key if conflicts_on == 'key' else self.name
-                        }' """
-                        f"is already present in table '{table.name}'."
+                        }' """ f"is already present in table '{table.name}'."
                     )
                 for fk in existing_col.foreign_keys:
                     table.foreign_keys.remove(fk)
index d7fd2cc9d26a95a69aebdf9bbdd6a6af335df77f..4a2a318dc190bc62b0d8c104f7baebcc0da96c5c 100644 (file)
@@ -103,7 +103,6 @@ from ..util.typing import Literal
 from ..util.typing import Protocol
 from ..util.typing import Self
 
-
 and_ = BooleanClauseList.and_
 
 
@@ -5063,7 +5062,7 @@ class SelectState(util.MemoizedSlots, CompileState):
                     raw_columns, left, right, onclause
                 )
             else:
-                (replace_from_obj_index) = self._join_place_explicit_left_side(
+                replace_from_obj_index = self._join_place_explicit_left_side(
                     left
                 )
 
index dccc64bba16452583fc3b8fd9ba2b489600d5efd..98fa8890f98a4f6abc6580cea8905f3dc44cc07c 100644 (file)
@@ -7,6 +7,7 @@
 # mypy: allow-untyped-defs, allow-untyped-calls
 
 """SQL specific types."""
+
 from __future__ import annotations
 
 import collections.abc as collections_abc
@@ -3637,7 +3638,6 @@ class Uuid(Emulated, TypeEngine[_UUID_RETURN]):
         from sqlalchemy import Uuid
         from sqlalchemy import Table, Column, MetaData, String
 
-
         metadata_obj = MetaData()
 
         t = Table(
index c9b6290f46e3aa49f139be36120335bb78c57000..56a7c5f688632fc06960097d79ddb0b0cea2a191 100644 (file)
@@ -35,7 +35,6 @@ from .. import util
 from ..util import langhelpers
 from ..util.typing import Self
 
-
 SKIP_TRAVERSE = util.symbol("skip_traverse")
 COMPARE_FAILED = False
 COMPARE_SUCCEEDED = True
index a0a0934f4dc03ec6eebab18a141be24c276c637a..9f1127b01ec807cb0f985d477e8897a87d7a0013 100644 (file)
@@ -7,6 +7,7 @@
 # mypy: allow-untyped-defs, allow-untyped-calls
 
 """High level utilities which build upon other modules here."""
+
 from __future__ import annotations
 
 from collections import deque
@@ -852,7 +853,7 @@ def splice_joins(
     adapter = ClauseAdapter(left)
     ret = None
     while stack:
-        (right, prevright) = stack.pop()
+        right, prevright = stack.pop()
         if isinstance(right, Join) and right is not stop_on:
             right = right._clone()
             right.onclause = adapter.traverse(right.onclause)
index 5c20ee728a935f36439ff6f9eec42675cf9fbf19..e509c94136578baccad0b5cfb4fcc061f2979aed 100644 (file)
@@ -27,7 +27,6 @@ from .. import pool
 from ..util import await_only
 from ..util.typing import Literal
 
-
 if typing.TYPE_CHECKING:
     from ..engine import Engine
     from ..engine.url import URL
index 2bed5fc328eb2a03037b1d724866d2648c01d3c3..baac539afb3a60646c8e9d57ec4c71ca0d48ec7d 100644 (file)
@@ -42,8 +42,7 @@ class MypyTest(TestBase):
             with open(
                 Path(cachedir) / "sqla_mypy_config.cfg", "w"
             ) as config_file:
-                config_file.write(
-                    f"""
+                config_file.write(f"""
                     [mypy]\n
                     plugins = sqlalchemy.ext.mypy.plugin\n
                     show_error_codes = True\n
@@ -53,13 +52,11 @@ class MypyTest(TestBase):
                     [mypy-sqlalchemy.*]
                     ignore_errors = True
 
-                    """
-                )
+                    """)
             with open(
                 Path(cachedir) / "plain_mypy_config.cfg", "w"
             ) as config_file:
-                config_file.write(
-                    f"""
+                config_file.write(f"""
                     [mypy]\n
                     show_error_codes = True\n
                     {mypy_path}
@@ -67,8 +64,7 @@ class MypyTest(TestBase):
                     [mypy-sqlalchemy.*]
                     ignore_errors = True
 
-                    """
-                )
+                    """)
             yield cachedir
 
     @config.fixture()
index 3d0d06241d88f52791bcd66cf03c0d4731e68386..5498e87c616072b3d3bb77a6e81f824e17678d86 100644 (file)
@@ -27,7 +27,6 @@ import importlib.util
 import os
 import sys
 
-
 bootstrap_file = locals()["bootstrap_file"]
 to_bootstrap = locals()["to_bootstrap"]
 
index bee8189edb92995aef4090fb0d8deb5a236bf35f..c430e76c1053eebcd8b8c63d921d90a352453ffe 100644 (file)
@@ -654,13 +654,10 @@ def _pytest_fn_decorator(target):
             __target_fn="__target_fn", __orig_fn="__orig_fn", name=fn.__name__
         )
         metadata.update(format_argspec_plus(spec, grouped=False))
-        code = (
-            """\
+        code = """\
 def %(name)s%(grouped_args)s:
     return %(__target_fn)s(%(__orig_fn)s, %(apply_kw)s)
-"""
-            % metadata
-        )
+""" % metadata
         decorated = _exec_code_in_env(
             code, {"__target_fn": target, "__orig_fn": fn}, fn.__name__
         )
index 37ddc02337f0e4063d38c318de63c1833029d10d..79a45871d40499b05fae5ff3b23ba6b3cfa399e6 100644 (file)
@@ -29,7 +29,6 @@ from .util import gc_collect
 from ..util import freethreading
 from ..util import has_compiled_ext
 
-
 try:
     import cProfile
 except ImportError:
index b61cb5035f73c0e66feb05f5b7a7ec8a94f39cc7..a3f72363e34cd4ea3e80a70aee031fe5032a0e09 100644 (file)
@@ -25,7 +25,6 @@ from ..sql import ddl
 from ..sql import schema
 from ..util import decorator
 
-
 log = logging.getLogger(__name__)
 
 FOLLOWER_IDENT = None
index 8f6fe56842bcb173543255c2f83a39cb548fb2ed..d808783eb9425f2dcc8d11e45fbed6fb7c609d34 100644 (file)
@@ -52,7 +52,6 @@ from ...testing import is_none
 from ...testing import is_true
 from ...testing import mock
 
-
 metadata, users = None, None
 
 
index 05aff5f36cf92fd89162f9312aa49c83a97861cd..8e2c6996d97465a84a72e205e6e50e82c288d824 100644 (file)
@@ -40,7 +40,6 @@ from ..util import defaultdict
 from ..util import has_refcount_gc
 from ..util import inspect_getfullargspec
 
-
 if not has_refcount_gc:
 
     def non_refcount_gc_collect(*args):
index 23b9eac403a82689cf662f1a92ee7764e41685b4..27e366993923c10266f788c39758c89a4f63959b 100644 (file)
@@ -7,7 +7,6 @@
 
 """Compatibility namespace for sqlalchemy.sql.types."""
 
-
 from __future__ import annotations
 
 from .sql.sqltypes import _Binary as _Binary
index f67fbf7c1e5760e0315aa2d63d6e6a5d3a0eaea2..8ac193f151abc3e2e9ee87f7a699350f981df514 100644 (file)
@@ -7,6 +7,7 @@
 # mypy: allow-untyped-defs, allow-untyped-calls
 
 """Collection classes and helpers."""
+
 from __future__ import annotations
 
 import operator
@@ -63,7 +64,6 @@ else:
         unique_list as unique_list,
     )
 
-
 _T = TypeVar("_T", bound=Any)
 _KT = TypeVar("_KT", bound=Any)
 _VT = TypeVar("_VT", bound=Any)
index 94762422513fa6a4e3f13f3580cfdb2451890c86..de4c9515b92e7d1a471fc2c3964d83d5a86d4363 100644 (file)
@@ -33,7 +33,6 @@ from typing import Tuple
 from typing import Type
 from typing import TypeVar
 
-
 py314b1 = sys.version_info >= (3, 14, 0, "beta", 1)
 py314 = sys.version_info >= (3, 14)
 py313 = sys.version_info >= (3, 13)
index cb72771e37b9913a409d0b047e4c2d7133da486a..febe5dbee2cd9369c23132b9b801b2072f94c251 100644 (file)
@@ -10,6 +10,7 @@
 modules, classes, hierarchies, attributes, functions, and methods.
 
 """
+
 from __future__ import annotations
 
 import collections
@@ -277,21 +278,15 @@ def decorator(target: Callable[..., Any]) -> Callable[[_Fn], _Fn]:
         # more kinds of methods that use @decorator, things may have to
         # be further improved in this area
         if "__" in repr(spec[0]):
-            code = (
-                """\
+            code = """\
 %(prefix)sdef %(name)s%(grouped_args)s:
     return %(target_prefix)s%(target)s(%(fn)s, %(apply_pos)s)
-"""
-                % metadata
-            )
+""" % metadata
         else:
-            code = (
-                """\
+            code = """\
 %(prefix)sdef %(name)s%(grouped_args)s:
     return %(target_prefix)s%(target)s(%(fn)s, %(apply_kw)s)
-"""
-                % metadata
-            )
+""" % metadata
 
         env: Dict[str, Any] = {
             targ_name: target,
@@ -1564,9 +1559,13 @@ class hybridmethod(Generic[_T]):
 
     def __get__(self, instance: Any, owner: Any) -> Callable[..., _T]:
         if instance is None:
-            return self.clslevel.__get__(owner, owner.__class__)  # type:ignore
+            return self.clslevel.__get__(  # type: ignore[no-any-return]
+                owner, owner.__class__
+            )
         else:
-            return self.func.__get__(instance, owner)  # type:ignore
+            return self.func.__get__(  # type: ignore[no-any-return]
+                instance, owner
+            )
 
     def classlevel(self, func: Callable[..., Any]) -> hybridmethod[_T]:
         self.clslevel = func
@@ -1862,7 +1861,7 @@ def _warnings_warn(
 
             if frame.f_code in _warning_tags:
                 warning_tag_found = True
-                (_suffix, _category) = _warning_tags[frame.f_code]
+                _suffix, _category = _warning_tags[frame.f_code]
                 category = category or _category
                 message = f"{message} ({_suffix})"
 
index b57abdc4d567295d8640e6f171d41dd40f8fbc53..6ef6719568a8d04fa10a471f2c2f3a3cfa547e71 100644 (file)
@@ -10,6 +10,7 @@
 runtime.
 
 """
+
 from __future__ import annotations
 
 import sys
index c89f9d23c69849c8ca9881cae054a80d843b943b..ab4f3e3a4c239a0cc8f4690554882e61c2dd4bff 100644 (file)
@@ -18,6 +18,7 @@ producing a ``put()`` inside the ``get()`` and therefore a reentrant
 condition.
 
 """
+
 from __future__ import annotations
 
 import asyncio
@@ -36,7 +37,6 @@ from .concurrency import await_fallback
 from .concurrency import await_only
 from .langhelpers import memoized_property
 
-
 _T = TypeVar("_T", bound=Any)
 __all__ = ["Empty", "Full", "Queue"]
 
index 9e1246f8f01a53120d8d4a30c4980f9036436042..7ad4fbf6a1d985f03e6d673a95b8a6e5ff3ab12a 100644 (file)
@@ -11,6 +11,7 @@ These aren't imported by the enclosing util package as the are not
 needed for normal library use.
 
 """
+
 from __future__ import annotations
 
 from argparse import ArgumentParser
index 628ff4af61bc178e4f3f571767cb474996811f47..0f870d68745866eef2c66eabd307f1b87ee2180d 100644 (file)
@@ -88,7 +88,7 @@ lint = [
     "flake8-rst-docstrings",
     "pydocstyle<4.0.0",
     "pygments",
-    "black==25.11.0",
+    "black==26.3.1",
     "slotscheck>=0.17.0",
     "zimports>=0.7.0",  # required by generate_tuple_map_overloads
 ]
index c6d2616e6dab394df0c7c9fec0f35e2c9e1d7b45..cb2d402bd7102c98b0aa67d86184ec157708a920 100644 (file)
@@ -16,7 +16,6 @@ import sys
 
 from sqlalchemy.testing import provision
 
-
 logging.basicConfig()
 logging.getLogger(provision.__name__).setLevel(logging.INFO)
 
index dced8dee06333e372fb3f137dbeba3b173d0f7bb..e7a8482de01198cefea18b06aa74f2cd64631ae0 100644 (file)
@@ -10,7 +10,6 @@ from sqlalchemy.testing import AssertsExecutionResults
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import profiling
 
-
 t1 = t2 = None
 
 
index 049e4a45e50064f352a21f57eab7322132e11103..07e74450c6c02d16c82f33c5c1f1a4ebf8247a00 100644 (file)
@@ -13,7 +13,6 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import profiling
 
-
 NUM_FIELDS = 10
 NUM_RECORDS = 1000
 
index 4baddfb105ae9713aab1f2e83461f1c02d7a92ad..113626553e0f4a776913c756781ed5e8dbc3a3d4 100644 (file)
@@ -3,7 +3,6 @@ import sys
 
 from sqlalchemy.testing import fixtures
 
-
 here = os.path.dirname(__file__)
 sqla_base = os.path.normpath(os.path.join(here, "..", ".."))
 
index b7f2d945cacce6b892323753dcb4cbb56f0aacb0..a39f66c29675f537045b565e11ac26463aab868c 100755 (executable)
@@ -6,12 +6,12 @@ This script is an extension to pytest which
 installs SQLAlchemy's testing plugin into the local environment.
 
 """
+
 import os
 import sys
 
 import pytest
 
-
 os.environ["SQLALCHEMY_WARN_20"] = "true"
 
 collect_ignore_glob = []
index 33f648b82a0f0765bdcb8a592595432756bfaf3b..28c0de2e75e32abb8acdb6c9a2159ee1bbc22810 100644 (file)
@@ -443,20 +443,16 @@ class MatchTest(AssertsCompiledSQL, fixtures.TablesTest):
         event.listen(
             metadata,
             "after_create",
-            DDL(
-                """CREATE FULLTEXT INDEX
+            DDL("""CREATE FULLTEXT INDEX
                        ON cattable (description)
-                       KEY INDEX PK_cattable"""
-            ),
+                       KEY INDEX PK_cattable"""),
         )
         event.listen(
             metadata,
             "after_create",
-            DDL(
-                """CREATE FULLTEXT INDEX
+            DDL("""CREATE FULLTEXT INDEX
                        ON matchtable (title)
-                       KEY INDEX PK_matchtable"""
-            ),
+                       KEY INDEX PK_matchtable"""),
         )
 
         event.listen(
@@ -614,8 +610,7 @@ class TableValuedTest(fixtures.TestBase):
 
     @testing.fixture
     def scalar_strings(self, connection):
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
 
 CREATE FUNCTION scalar_strings (
 )
@@ -627,15 +622,13 @@ RETURN
     FROM (
         VALUES ('some string'), ('some string'), ('some string')
     ) AS my_tab(my_string)
-        """
-        )
+        """)
         yield
         connection.exec_driver_sql("DROP FUNCTION scalar_strings")
 
     @testing.fixture
     def two_strings(self, connection):
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
 CREATE FUNCTION three_pairs (
 )
 RETURNS TABLE
@@ -646,8 +639,7 @@ RETURN
     FROM (
         VALUES ('a', 'b'), ('c', 'd'), ('e', 'f')
     ) AS my_tab(s1, s2)
-"""
-        )
+""")
         yield
         connection.exec_driver_sql("DROP FUNCTION three_pairs")
 
index 1f8a23f70dc945793ac2bb3cff9dba59ba9c2e73..e96d08f4ceb9954244aede6ce0afe0410e4498f7 100644 (file)
@@ -516,8 +516,7 @@ class OutParamTest(fixtures.TestBase, AssertsExecutionResults):
     @classmethod
     def setup_test_class(cls):
         with testing.db.begin() as c:
-            c.exec_driver_sql(
-                """
+            c.exec_driver_sql("""
 create or replace procedure foo(x_in IN number, x_out OUT number,
 y_out OUT number, z_out OUT varchar) IS
 retval number;
@@ -527,8 +526,7 @@ begin
     y_out := x_in * 15;
     z_out := NULL;
 end;
-                """
-            )
+                """)
 
     def test_out_params(self, connection):
         result = connection.execute(
@@ -1132,8 +1130,7 @@ class TableValuedTest(fixtures.TestBase):
         connection.exec_driver_sql(
             "CREATE OR REPLACE TYPE strings_t IS TABLE OF VARCHAR2 (100)"
         )
-        connection.exec_driver_sql(
-            r"""
+        connection.exec_driver_sql(r"""
 CREATE OR REPLACE FUNCTION scalar_strings (
    count_in IN INTEGER, string_in IN VARCHAR2)
    RETURN strings_t
@@ -1150,31 +1147,25 @@ BEGIN
 
    RETURN l_strings;
 END;
-        """
-        )
+        """)
         yield
         connection.exec_driver_sql("DROP FUNCTION scalar_strings")
         connection.exec_driver_sql("DROP TYPE strings_t")
 
     @testing.fixture
     def two_strings(self, connection):
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
 CREATE OR REPLACE TYPE two_strings_ot
    AUTHID DEFINER IS OBJECT
 (
    string1 VARCHAR2 (10),
    string2 VARCHAR2 (10)
-)"""
-        )
-        connection.exec_driver_sql(
-            """
+)""")
+        connection.exec_driver_sql("""
             CREATE OR REPLACE TYPE two_strings_nt IS TABLE OF two_strings_ot
-"""
-        )
+""")
 
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
         CREATE OR REPLACE FUNCTION three_pairs
    RETURN two_strings_nt
    AUTHID DEFINER
@@ -1185,8 +1176,7 @@ BEGIN
                           two_strings_ot ('c', 'd'),
                           two_strings_ot ('e', 'f'));
 END;
-"""
-        )
+""")
         yield
         connection.exec_driver_sql("DROP FUNCTION three_pairs")
         connection.exec_driver_sql("DROP TYPE two_strings_nt")
index 456b056a09494b5b7620eed83d0677cb9b16383c..9b6adb9166e3db0642c028dbd21bbf29af333ea8 100644 (file)
@@ -64,8 +64,7 @@ class MultiSchemaTest(fixtures.TestBase, AssertsCompiledSQL):
         # we connect as the other user.
 
         with testing.db.begin() as conn:
-            for stmt in (
-                """
+            for stmt in ("""
     create table %(test_schema)s.parent(
         id integer primary key,
         data varchar2(50)
@@ -97,17 +96,14 @@ class MultiSchemaTest(fixtures.TestBase, AssertsCompiledSQL):
     -- so we give it to public.  ideas welcome.
     grant references on %(test_schema)s.parent to public;
     grant references on %(test_schema)s.child to public;
-    """
-                % {"test_schema": testing.config.test_schema}
-            ).split(";"):
+    """ % {"test_schema": testing.config.test_schema}).split(";"):
                 if stmt.strip():
                     conn.exec_driver_sql(stmt)
 
     @classmethod
     def teardown_test_class(cls):
         with testing.db.begin() as conn:
-            for stmt in (
-                """
+            for stmt in ("""
     drop table %(test_schema)s.child;
     drop table %(test_schema)s.parent;
     drop table local_table;
@@ -116,9 +112,7 @@ class MultiSchemaTest(fixtures.TestBase, AssertsCompiledSQL):
     drop synonym %(test_schema)s_pt;
     drop synonym %(test_schema)s.local_table;
 
-    """
-                % {"test_schema": testing.config.test_schema}
-            ).split(";"):
+    """ % {"test_schema": testing.config.test_schema}).split(";"):
                 if stmt.strip():
                     conn.exec_driver_sql(stmt)
 
@@ -767,9 +761,7 @@ class ViewReflectionTest(fixtures.TestBase):
             )
             sql += """
     CREATE SYNONYM syn_link FOR tbl_plain_v@%(link)s;
-    """ % {
-                "link": cls.dblink
-            }
+    """ % {"link": cls.dblink}
         with testing.db.begin() as conn:
             for stmt in (
                 sql % {"test_schema": testing.config.test_schema}
@@ -1019,20 +1011,14 @@ class RoundTripIndexTest(fixtures.TestBase):
             Column("other", Unicode(255), index=True),
         )
         metadata.create_all(connection)
-        connection.exec_driver_sql(
-            """create index idx3 on sometable(
-                lower("group"), other, upper(other))"""
-        )
-        connection.exec_driver_sql(
-            """create index idx1 on sometable
-            (("group" || col), col || other desc)"""
-        )
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""create index idx3 on sometable(
+                lower("group"), other, upper(other))""")
+        connection.exec_driver_sql("""create index idx1 on sometable
+            (("group" || col), col || other desc)""")
+        connection.exec_driver_sql("""
             create unique index idx2 on sometable
                 (col desc, lower(other), "group" asc)
-            """
-        )
+            """)
 
         expected = [
             {
@@ -1157,13 +1143,11 @@ class RoundTripIndexTest(fixtures.TestBase):
 
         # find what the primary k constraint name should be
         primaryconsname = connection.scalar(
-            text(
-                """SELECT constraint_name
+            text("""SELECT constraint_name
                FROM all_constraints
                WHERE table_name = :table_name
                AND owner = :owner
-               AND constraint_type = 'P' """
-            ),
+               AND constraint_type = 'P' """),
             dict(
                 table_name=s_table.name.upper(),
                 owner=testing.db.dialect.default_schema_name.upper(),
index ce8ff27a2d172b7eaef9d19f654b0057b3826082..d41ef09adeb550eb3772b07446f56047054fe12d 100644 (file)
@@ -166,15 +166,12 @@ class DialectTest(fixtures.TestBase):
         event.listen(
             metadata,
             "after_create",
-            DDL(
-                """
+            DDL("""
 CREATE OR REPLACE FUNCTION %s.version() RETURNS integer AS $$
 BEGIN
     return 0;
 END;
-$$ LANGUAGE plpgsql;"""
-                % (default_schema_name,)
-            ),
+$$ LANGUAGE plpgsql;""" % (default_schema_name,)),
         )
         event.listen(
             metadata,
@@ -1276,16 +1273,14 @@ class MiscBackendTest(
             conn = testing.db.connect()
             trans = conn.begin()
             try:
-                conn.exec_driver_sql(
-                    """
+                conn.exec_driver_sql("""
 CREATE OR REPLACE FUNCTION note(message varchar) RETURNS integer AS $$
 BEGIN
   RAISE NOTICE 'notice: %%', message;
   RETURN NULL;
 END;
 $$ LANGUAGE plpgsql;
-"""
-                )
+""")
                 conn.exec_driver_sql("SELECT note('hi there')")
                 conn.exec_driver_sql("SELECT note('another note')")
             finally:
@@ -1460,18 +1455,14 @@ $$ LANGUAGE plpgsql;
         execute that DefaultClause upon insert."""
 
         meta = self.metadata
-        connection.execute(
-            text(
-                """
+        connection.execute(text("""
                  CREATE TABLE speedy_users
                  (
                      speedy_user_id   SERIAL     PRIMARY KEY,
                      user_name        VARCHAR    NOT NULL,
                      user_password    VARCHAR    NOT NULL
                  );
-                """
-            )
-        )
+                """))
         t = Table("speedy_users", meta, autoload_with=connection)
         r = connection.execute(
             t.insert(), dict(user_name="user", user_password="lala")
index df7247dd7aa48b7b16738d2fde4d8424e9bd7f18..5120d97a3421062db6f9d4d33a2aafa271a5c06b 100644 (file)
@@ -1718,34 +1718,28 @@ class ReflectionTest(
             Column("other", String(20)),
         )
         metadata.create_all(connection)
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
             create index idx3 on party
                 (lower(name::text), other, lower(aname::text) desc)
-            """
-        )
+            """)
         connection.exec_driver_sql(
             "create index idx1 on party ((id || name), (other || id::text))"
         )
         connection.exec_driver_sql(
             "create unique index idx2 on party (id) where name = 'test'"
         )
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
             create index idx4 on party using btree
                 (name nulls first, lower(other), aname desc)
                 where name != 'foo'
-            """
-        )
+            """)
         version = connection.dialect.server_version_info
         if version >= (15,):
-            connection.exec_driver_sql(
-                """
+            connection.exec_driver_sql("""
                 create unique index zz_idx5 on party
                     (name desc, upper(other))
                     nulls not distinct
-                """
-            )
+                """)
 
         expected = [
             {
@@ -1889,28 +1883,22 @@ class ReflectionTest(
         t1.create(connection)
 
         # check ASC, DESC options alone
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
             create index idx1 on party
                 (id, name ASC, aname DESC)
-        """
-        )
+        """)
 
         # check DESC w/ NULLS options
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
           create index idx2 on party
                 (name DESC NULLS FIRST, aname DESC NULLS LAST)
-        """
-        )
+        """)
 
         # check ASC w/ NULLS options
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
           create index idx3 on party
                 (name ASC NULLS FIRST, aname ASC NULLS LAST)
-        """
-        )
+        """)
 
         # reflect data
         m2 = MetaData()
@@ -2175,19 +2163,15 @@ class ReflectionTest(
         )
         metadata.create_all(connection)
         connection.exec_driver_sql("CREATE INDEX idx1 ON t (x) INCLUDE (name)")
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
             create index idx3 on t
                 (lower(name::text), other desc nulls last, lower(aname::text))
                 include (id, x)
-            """
-        )
-        connection.exec_driver_sql(
-            """
+            """)
+        connection.exec_driver_sql("""
             create unique index idx2 on t using btree
                 (lower(other), (id * id)) include (id)
-            """
-        )
+            """)
 
         ind = connection.dialect.get_indexes(connection, "t", None)
         eq_(
index 7c562bf39d11e95a684e87c86755a1e33f995298..f41850f90f595d2f346c046f28c4aba8869ff4f0 100644 (file)
@@ -29,7 +29,6 @@ from sqlalchemy.testing import mock
 from sqlalchemy.testing import ne_
 from sqlalchemy.testing.assertions import expect_raises_message
 
-
 dialect = None
 
 
index b034e3be78dd0cba6344f02c2bb625b684f8e1b3..ed39465c9e2b224f1fcc4daf7dffcd3a461436d0 100644 (file)
@@ -480,10 +480,8 @@ class PoolEventsTest(PoolTestBase):
         @event.listens_for(p, "reset")
         def reset(conn, rec, state):
             canary.append(
-                f"""reset_{
-                    'rollback_ok'
-                    if state.asyncio_safe else 'no_rollback'
-                }"""
+                "reset_"
+                f"{'rollback_ok' if state.asyncio_safe else 'no_rollback'}"
             )
 
         @event.listens_for(p, "checkin")
index 65857eaec44d7ff0f7ce055733807c4058ea9264..3e70425327cc8fa4aa965713a9bf82b8b1e29560 100644 (file)
@@ -1068,8 +1068,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
         indexes"""
 
         conn = connection
-        conn.exec_driver_sql(
-            """
+        conn.exec_driver_sql("""
             CREATE TABLE book (
                 id INTEGER NOT NULL,
                 title VARCHAR(100) NOT NULL,
@@ -1077,8 +1076,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
                 series_id INTEGER,
                 UNIQUE(series, series_id),
                 PRIMARY KEY(id)
-            )"""
-        )
+            )""")
 
         book = Table("book", metadata, autoload_with=connection)
         assert book.primary_key.contains_column(book.c.id)
@@ -1107,8 +1105,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
         """test reflection of a composite primary key"""
 
         conn = connection
-        conn.exec_driver_sql(
-            """
+        conn.exec_driver_sql("""
             CREATE TABLE book (
                 id INTEGER NOT NULL,
                 isbn VARCHAR(50) NOT NULL,
@@ -1117,8 +1114,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
                 series_id INTEGER NOT NULL,
                 UNIQUE(series, series_id),
                 PRIMARY KEY(id, isbn)
-            )"""
-        )
+            )""")
         book = Table("book", metadata, autoload_with=connection)
         assert book.primary_key.contains_column(book.c.id)
         assert book.primary_key.contains_column(book.c.isbn)
@@ -2042,15 +2038,13 @@ class ReverseCasingReflectTest(fixtures.TestBase, AssertsCompiledSQL):
     @testing.requires.denormalized_names
     def setup_test(self):
         with testing.db.begin() as conn:
-            conn.exec_driver_sql(
-                """
+            conn.exec_driver_sql("""
             CREATE TABLE weird_casing(
                     col1 char(20),
                     "Col2" char(20),
                     "col3" char(20)
             )
-            """
-            )
+            """)
 
     @testing.requires.denormalized_names
     def teardown_test(self):
index d11631d75b765edb9c8d4ca3fa69ff07ae6a97a6..91e29f276248ef0331559f88eb43903b0804fabd 100644 (file)
@@ -3,7 +3,6 @@ from sqlalchemy import Integer
 from sqlalchemy import String
 from sqlalchemy.orm import declarative_base
 
-
 Base = declarative_base()
 
 
index a2825e003724d2da1fba6daa63e147d0460a5fce..560a62973524bba0a953e29afedc564b368723cc 100644 (file)
@@ -3,7 +3,6 @@ from sqlalchemy import Integer
 from sqlalchemy import String
 from sqlalchemy.orm import registry
 
-
 reg: registry = registry()
 
 
index 1f2261cfcc23499ebe90cbbecc78ecfbb3fb30f0..ac9e708ee73a6d4b64a2d69994b582d39b3135fe 100644 (file)
@@ -6,7 +6,6 @@ from sqlalchemy.sql.schema import ForeignKey
 from sqlalchemy.sql.schema import MetaData
 from sqlalchemy.sql.schema import Table
 
-
 reg: registry = registry()
 
 
index a20af490dc7737e086f943f4888759f896d80eeb..2c266cf4f43afc136b4679956f74050f775278ce 100644 (file)
@@ -7,7 +7,6 @@ from sqlalchemy.sql.schema import ForeignKey
 from sqlalchemy.sql.schema import MetaData
 from sqlalchemy.sql.schema import Table
 
-
 Base = declarative_base()
 
 
index 0548a79268e430774f2413db72c6d241caba706a..5ecb960ae716df53455e67833bf6168f73bcdee9 100644 (file)
@@ -9,7 +9,6 @@ from sqlalchemy import Table
 from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import Mapped
 
-
 Base = declarative_base()
 
 
index d4cd7f2c4352416013ffc0860d6d02eed0563094..cd26a809da93d6170e783b7d32ece9bcece57daa 100644 (file)
@@ -4,7 +4,6 @@ from typing import Dict
 from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import declared_attr
 
-
 Base = declarative_base()
 
 
index 4227f2797e898eaf497abf2be2d7e142c0f92c85..720a6214ec34e88b73f8c2353d1869c1effdac6e 100644 (file)
@@ -5,7 +5,6 @@ from typing import Type
 from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import declared_attr
 
-
 Base = declarative_base()
 
 
index 9a4865eb6d351ac7efaba477f0cb28d4a0532554..e82b4d91456846e17b263f19b755157d5c9441bf 100644 (file)
@@ -4,7 +4,6 @@ from sqlalchemy import String
 from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import registry
 
-
 reg: registry = registry()
 
 Base = declarative_base()
index a471edf6c7e3997860faca348f7f8e35d214b860..b5797ba81aae57f436ede78ecc406c09d13d0a70 100644 (file)
@@ -4,7 +4,6 @@ from sqlalchemy import String
 from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import registry
 
-
 reg: registry = registry()
 
 # TODO: also reg.as_declarative_base()
index 900b28fa494e0cf6b4f8f91be84c0b16caa095fb..fe705349a1ff93b3aabb2871c4314c546844e580 100644 (file)
@@ -12,7 +12,6 @@ from sqlalchemy.orm.decl_api import declared_attr
 from sqlalchemy.orm.interfaces import MapperProperty
 from sqlalchemy.sql.schema import ForeignKey
 
-
 reg: registry = registry()
 
 
index cfbe83d35db230dce2f353316d5e05036cb55783..86e59800a40cc9725a6d0e958b53bc60f3972ab3 100644 (file)
@@ -5,7 +5,6 @@ from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import declared_attr
 from sqlalchemy.orm import Mapped
 
-
 Base = declarative_base()
 
 
index a37ae6b06f55d257b66b91bb11db434b432cb835..1b05bd0045f485e9ebdbfa3b5798379ce6fb0f9a 100644 (file)
@@ -4,7 +4,6 @@ from typing import Optional
 import sqlalchemy as sa
 from sqlalchemy import orm as saorm
 
-
 Base = saorm.declarative_base()
 
 
index 146b96b2a73425fb01bc9d8ab52ed4f699607542..c74d8990195675d32e89e514b3876da05ba9b9ff 100644 (file)
@@ -14,7 +14,6 @@ from sqlalchemy.orm import Mapped
 from sqlalchemy.orm import relationship
 from sqlalchemy.orm.decl_api import declared_attr
 
-
 Base = declarative_base()
 
 
index 47756c94958e5edcd77c5419b71b4cd3bcd822b3..d107be31b9dfc543d62e60e265f43393afc6dd46 100644 (file)
@@ -404,7 +404,7 @@ class UserDefinedExtensionTest(_ExtBase, fixtures.ORMTest):
                 useobject=True,
             )
             b = Blog()
-            (p1, p2, p3) = (Post(), Post(), Post())
+            p1, p2, p3 = (Post(), Post(), Post())
             b.posts.append(p1)
             b.posts.append(p2)
             b.posts.append(p3)
index d3fd2a9a045e79a931b2fcb4c6ccc6dc417969bf..b12f9bc6f51381f5391a2a0a62b600001d57e5eb 100644 (file)
@@ -13,7 +13,6 @@ from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
 from sqlalchemy.testing.util import picklers
 
-
 metadata = None
 
 
index 783bfa14ab6d8ebb84347633e0ecb54d0c73c4a9..c3fd6b81077411a878064e0f7ccb62d5d0ffd522 100644 (file)
@@ -9,7 +9,6 @@ from sqlalchemy.testing import fixtures
 from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
 
-
 __all__ = ()
 
 
index 1f31544e06527a02997a149dbc056ce80af13493..607609729c2857df22f45d88346a57d7d9c5f866 100644 (file)
@@ -65,7 +65,6 @@ from sqlalchemy.testing.fixtures import fixture_session
 from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
 
-
 Base = None
 
 User = Address = None
index 462aec89764e52f535e9c23e75fbd068780d657c..0e7e531ff016529c43b13ab073603294765752b8 100644 (file)
@@ -41,7 +41,6 @@ from .test_typed_mapping import expect_annotation_syntax_error
 from .test_typed_mapping import MappedColumnTest as _MappedColumnTest
 from .test_typed_mapping import RelationshipLHSTest as _RelationshipLHSTest
 
-
 _R = TypeVar("_R")
 
 M = Mapped
index 0c4647d8186c2d54a2d661e97e9dcd594442a352..c5eb66b40658190c19671108ebaea5b62a8c1e01 100644 (file)
@@ -104,7 +104,6 @@ from sqlalchemy.testing.fixtures import fixture_session
 from sqlalchemy.util import compat
 from sqlalchemy.util.typing import Annotated
 
-
 # try to differentiate between typing_extensions.TypeAliasType
 # and typing.TypeAliasType
 TypingTypeAliasType = getattr(typing, "TypeAliasType", TypeAliasType)
index dbd208ca799f467028d6b2a776b38a6a2750f10f..42c11fd0fad96de74b1198b19996a8e78e8b8761 100644 (file)
@@ -95,7 +95,6 @@ from sqlalchemy.testing.fixtures import fixture_session
 from sqlalchemy.util import compat
 from sqlalchemy.util.typing import Annotated
 
-
 # try to differentiate between typing_extensions.TypeAliasType
 # and typing.TypeAliasType
 TypingTypeAliasType = getattr(typing, "TypeAliasType", TypeAliasType)
index b1830cdc51cc97c311d85fc6d9230147df5fc103..0b52bbe5ef4f87e85b74dac3bfc632f7cd78da17 100644 (file)
@@ -1177,7 +1177,7 @@ class BackrefTest(fixtures.ORMTest):
         s.courses.remove(c)
         self.assert_(c.students == [])
 
-        (s1, s2, s3) = (Student(), Student(), Student())
+        s1, s2, s3 = (Student(), Student(), Student())
 
         c.students = [s1, s2, s3]
         self.assert_(s2.courses == [c])
@@ -1211,7 +1211,7 @@ class BackrefTest(fixtures.ORMTest):
             useobject=True,
         )
         b = Blog()
-        (p1, p2, p3) = (Post(), Post(), Post())
+        p1, p2, p3 = (Post(), Post(), Post())
         b.posts.append(p1)
         b.posts.append(p2)
         b.posts.append(p3)
index e0d75db7e16e1b515a6307e5bd61fa7f98996d15..e20ae0e3a7eed1b40f6110e28c5a6e757cdb3398 100644 (file)
@@ -2420,7 +2420,7 @@ class MixedEntitiesTest(QueryTest, AssertsCompiledSQL):
 
         test_session = fixture_session()
 
-        (user7, user8, user9, user10) = test_session.query(User).all()
+        user7, user8, user9, user10 = test_session.query(User).all()
         (
             address1,
             address2,
@@ -2498,8 +2498,8 @@ class MixedEntitiesTest(QueryTest, AssertsCompiledSQL):
 
         sess = fixture_session()
 
-        (user7, user8, user9, user10) = sess.query(User).all()
-        (address1, address2, address3, address4, address5) = sess.query(
+        user7, user8, user9, user10 = sess.query(User).all()
+        address1, address2, address3, address4, address5 = sess.query(
             Address
         ).all()
 
@@ -2585,7 +2585,7 @@ class MixedEntitiesTest(QueryTest, AssertsCompiledSQL):
 
         sess = fixture_session()
 
-        (user7, user8, user9, user10) = sess.query(User).all()
+        user7, user8, user9, user10 = sess.query(User).all()
         expected = [(user7, 1), (user8, 3), (user9, 1), (user10, 0)]
 
         q = sess.query(User)
@@ -2643,7 +2643,7 @@ class MixedEntitiesTest(QueryTest, AssertsCompiledSQL):
         )
 
         sess = fixture_session()
-        (user7, user8, user9, user10) = sess.query(User).all()
+        user7, user8, user9, user10 = sess.query(User).all()
         expected = [
             (user7, 1, "Name:jack"),
             (user8, 3, "Name:ed"),
index ff684d846bed062983e8f9d398bd3e01ba04a761..75973f1bec03999880ac602e848785593056a80d 100644 (file)
@@ -1389,8 +1389,8 @@ class JoinTest(QueryTest, AssertsCompiledSQL):
 
         sess = fixture_session()
 
-        (user7, user8, user9, user10) = sess.query(User).all()
-        (address1, address2, address3, address4, address5) = sess.query(
+        user7, user8, user9, user10 = sess.query(User).all()
+        address1, address2, address3, address4, address5 = sess.query(
             Address
         ).all()
         expected = [
@@ -1494,8 +1494,8 @@ class JoinTest(QueryTest, AssertsCompiledSQL):
 
         sess = fixture_session()
 
-        (order1, order2, order3, order4, order5) = sess.query(Order).all()
-        (item1, item2, item3, item4, item5) = sess.query(Item).all()
+        order1, order2, order3, order4, order5 = sess.query(Order).all()
+        item1, item2, item3, item4, item5 = sess.query(Item).all()
         expected = [
             (order1, item1),
             (order1, item2),
index 7403715492e932ff0da0356cf0949089bfe9ca94..8e43802098bf20f58f2435503184889e92a8c2ff 100644 (file)
@@ -506,7 +506,7 @@ class NaturalPKTest(fixtures.MappedTest):
         sess.flush()
 
         u1.username = "ed"
-        (ad1, ad2) = sess.query(Address).all()
+        ad1, ad2 = sess.query(Address).all()
         eq_([Address(username="jack"), Address(username="jack")], [ad1, ad2])
 
         def go():
index d4ea0e291951e358fd126cd52c75358ec3d96909..9efdbef1b22b46b7dfdd36f53fc3df9fc5383ace 100644 (file)
@@ -16,7 +16,6 @@ from sqlalchemy.testing.fixtures import fixture_session
 from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
 
-
 # TODO: more tests mapping to selects
 
 
index 547349868882e39503c38e2c7561ca67a9c6f4cd..a82ab73ceaaa2d9c2f93c1ab18bd154079e7aef8 100644 (file)
@@ -1195,7 +1195,7 @@ class DefaultTest(fixtures.MappedTest):
 
         session.expunge_all()
 
-        (h1, h2, h3, h4, h5) = session.query(Hoho).order_by(Hoho.id).all()
+        h1, h2, h3, h4, h5 = session.query(Hoho).order_by(Hoho.id).all()
 
         eq_(h1.hoho, althohoval)
         eq_(h3.hoho, althohoval)
index 2e11b7ca9306ae29c3123f0b916f6ce67c97177b..d7ac0aaa4e8297dc4df6a4b5e1e90b7dcf110769 100644 (file)
@@ -7,7 +7,6 @@ import gevent.monkey
 from sqlalchemy import create_engine
 from sqlalchemy import event
 
-
 gevent.monkey.patch_all()  # noqa
 
 logging.basicConfig()  # noqa
index 520944c9f0b6ef881e77c22c3cd3a3c732e88565..0a4d878f76330df32bb713274e9532b742323b34 100644 (file)
@@ -13,7 +13,6 @@ from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import relationship
 from sqlalchemy.orm import Session
 
-
 Base = declarative_base()
 
 
index 0e86565bd9491074ffc87a08d0aa5f2abb266d1d..d7ad8d09e690228f28b8d7280ba55279e8d6c53a 100644 (file)
@@ -115,7 +115,6 @@ from sqlalchemy.testing import Variation
 from sqlalchemy.testing.schema import pep435_enum
 from sqlalchemy.types import UserDefinedType
 
-
 if TYPE_CHECKING:
     from sqlalchemy import Select
 
index 8d60bac02eb00c6df6fa411611ca05d78b3d5e2f..05efed51a5644a0289e406ed1250e951ee627047 100644 (file)
@@ -55,7 +55,6 @@ from sqlalchemy.testing.assertions import expect_warnings
 from sqlalchemy.testing.engines import all_dialects
 from sqlalchemy.testing.provision import normalize_sequence
 
-
 table1 = table(
     "mytable",
     column("myid", Integer),
index fedda753b6ee022927efef52e5db212e3e567d37..7100ffa1256a4d8debd998f7543fc45b59efc362 100644 (file)
@@ -1160,7 +1160,7 @@ class CompoundTest(fixtures.TablesTest):
     @testing.requires.subqueries
     def test_union(self, connection):
         t1, t2, t3 = self.tables("t1", "t2", "t3")
-        (s1, s2) = (
+        s1, s2 = (
             select(t1.c.col3.label("col3"), t1.c.col4.label("col4")).where(
                 t1.c.col2.in_(["t1col2r1", "t1col2r2"]),
             ),
@@ -1187,7 +1187,7 @@ class CompoundTest(fixtures.TablesTest):
     def test_union_ordered(self, connection):
         t1, t2, t3 = self.tables("t1", "t2", "t3")
 
-        (s1, s2) = (
+        s1, s2 = (
             select(t1.c.col3.label("col3"), t1.c.col4.label("col4")).where(
                 t1.c.col2.in_(["t1col2r1", "t1col2r2"]),
             ),
@@ -1209,7 +1209,7 @@ class CompoundTest(fixtures.TablesTest):
     def test_union_ordered_alias(self, connection):
         t1, t2, t3 = self.tables("t1", "t2", "t3")
 
-        (s1, s2) = (
+        s1, s2 = (
             select(t1.c.col3.label("col3"), t1.c.col4.label("col4")).where(
                 t1.c.col2.in_(["t1col2r1", "t1col2r2"]),
             ),
index 7d97de94a2a90d8ab9e5d16d6d1aaad23d6f1138..d721819a6734fc0ab7ad8a6a3918973ea90ebc4e 100644 (file)
@@ -62,7 +62,6 @@ from sqlalchemy.testing import ne_
 from sqlalchemy.testing.assertions import expect_raises_message
 from sqlalchemy.testing.provision import normalize_sequence
 
-
 metadata = MetaData()
 table1 = Table(
     "table1",
index 0ca331f189f8c702361bee6b160430c6c81686ba..18476fddf38b3ef6c744911ccdf44294a969e61a 100644 (file)
@@ -3,7 +3,6 @@ import typing
 from sqlalchemy import create_engine
 from sqlalchemy import inspect
 
-
 e = create_engine("sqlite://")
 
 insp = inspect(e)
index 9afd0b8aff834352ccc59705594f439ae9eb8493..5b06ca7e7898ecb3b8daf87c7a64827d6f32bbdb 100644 (file)
@@ -6,7 +6,6 @@ from sqlalchemy.ext.asyncio import async_sessionmaker
 from sqlalchemy.ext.asyncio import AsyncSession
 from sqlalchemy.ext.asyncio import create_async_engine
 
-
 engine = create_async_engine("")
 SM = async_sessionmaker(engine, class_=AsyncSession)
 
index 60d2e8b33e3ee63dc7aeddb819acb6bd8a97d096..500b2e03511cfd94b631b971c0dfbf8f8058c644 100644 (file)
@@ -12,7 +12,6 @@ from sqlalchemy.orm import scoped_session
 from sqlalchemy.orm import Session
 from sqlalchemy.orm import sessionmaker
 
-
 async_engine = create_async_engine("...")
 
 
index b87e0524c1b34378f923461d5858ab058865b6c4..dbf1bbde706130d2a8a6298f33ac824b64155084 100644 (file)
@@ -20,7 +20,6 @@ from sqlalchemy.orm import Mapped
 from sqlalchemy.orm import mapped_column
 from sqlalchemy.orm import relationship
 
-
 if TYPE_CHECKING:
     from sqlalchemy.orm import InstrumentedAttribute
 
index 677a79069e639d51f078221c12bac7291f851063..71b24e11e4823384d6aaf3c22a11e90b6956b024 100644 (file)
@@ -27,7 +27,6 @@ from sqlalchemy.orm import Mapped
 from sqlalchemy.orm import mapped_column
 from sqlalchemy.orm import Session
 
-
 if TYPE_CHECKING:
     from sqlalchemy import Row
     from sqlalchemy.orm.query import RowReturningQuery
index 03d827ea7efd163f18495cf9f44ae92f95a23ffd..0f364fa71df54b5780af4dc6da2f34e8ffebd8c9 100644 (file)
@@ -16,7 +16,6 @@ from sqlalchemy import text
 from sqlalchemy import true
 from sqlalchemy import UUID
 
-
 m = MetaData()
 
 
index 278e2c9a88a0add41d2b1b3451910424b084a11a..2f0be66e824b77ed5f2b116d67f62cd9062e61c5 100644 (file)
@@ -14,7 +14,6 @@ from sqlalchemy import select
 from sqlalchemy import String
 from sqlalchemy import true
 
-
 # builtin.pyi stubs define object.__eq__() as returning bool,  which
 # can't be overridden (it's final).  So for us to type `__eq__()` and
 # `__ne__()`, we have to use type: ignore[override].  Test if does this mean
index 056e7ef70293fb9bd25d71785f870a0d5b482042..de97298496ab665e7d7b84b7b4635f47038f13db 100644 (file)
@@ -25,7 +25,6 @@ from black.files import parse_pyproject_toml
 from black.mode import Mode
 from black.mode import TargetVersion
 
-
 home = Path(__file__).parent.parent
 include_paths = (
     re.compile(r"lib/sqlalchemy"),
index b9f9d572b00517e19778cbc1f28ead136cbc4c45..0eae55e8bd7cc2f495455ccf5ea2b3cf1d556c84 100644 (file)
@@ -273,28 +273,22 @@ def process_class(
             metadata["after_line"] = ""
 
         if clslevel:
-            code = (
-                '''\
+            code = '''\
 @classmethod
 %(async)sdef %(name)s%(grouped_args)s:
     r"""%(doc)s\n    """  # noqa: E501
 
     %(line_prefix)s %(await)s%(target_cls_name)s.%(name)s(%(apply_kw_proxied)s)
     %(after_line)s
-'''
-                % metadata
-            )
+''' % metadata
         else:
-            code = (
-                '''\
+            code = '''\
 %(async)sdef %(name)s%(grouped_args)s:
     r"""%(doc)s\n    """  # noqa: E501
 
     %(line_prefix)s %(await)s%(self_arg)s._proxied.%(name)s(%(apply_kw_proxied)s)
     %(after_line)s
-'''  # noqa: E501
-                % metadata
-            )
+''' % metadata  # noqa: E501
 
         buf.write(textwrap.indent(code, "    "))
 
index 72bb08cc484d9c72d058adf5f129fc2e12ccd90f..734264a5dbecd58f73842be8c6406ff01a6ee033 100644 (file)
@@ -37,7 +37,6 @@ from typing import TYPE_CHECKING
 
 from sqlalchemy.orm import util
 
-
 if TYPE_CHECKING:
     from typing import Any
     from typing import List
diff --git a/tox.ini b/tox.ini
index f94bd3b6747ac6e391458893eb79368fe23816d4..80d47d27ae9da05409cff6d585821c13927f37a0 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -263,7 +263,7 @@ deps=
       # in case it requires a version pin
       pydocstyle
       pygments
-      black==25.11.0
+      black==26.3.1
       slotscheck>=0.17.0
 
       # required by generate_tuple_map_overloads