]> 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:00:42 +0000 (19:00 +0200)
Closes: #13280
Change-Id: Ifbb77dd6d2a1c228ae97fcf8160f40e975edc57c

173 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/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/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/json.py
lib/sqlalchemy/dialects/oracle/oracledb.py
lib/sqlalchemy/dialects/oracle/vector.py
lib/sqlalchemy/dialects/postgresql/__init__.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/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/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/interfaces.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/_util_cy.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/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/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/sql/core_ddl.py
test/typing/plain_files/sql/sql_operations.py
test/typing/plain_files/sql/sqltypes.py
tools/format_docs_code.py
tools/generate_proxy_methods.py
tools/trace_orm_adapter.py
tox.ini

index 07d00fbfb082db5ec0647bd4520cc10fbbfde755..bf95187374a34b7284891130c22c7e5a955feb1b 100644 (file)
@@ -4,7 +4,7 @@ default_language_version:
 
 repos:
 -   repo: https://github.com/python/black
-    rev: 25.11.0
+    rev: 26.3.1
     hooks:
     -   id: black
 
@@ -41,4 +41,4 @@ repos:
         types: [rst]
         exclude: README.*
         additional_dependencies:
-            - black==25.9.0
+            - black==26.3.1
index 670daac7ef90934eb7ab4afe148622a0084fb65c..defbc0305e6839df41ca5451347b77faa134f0b8 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 6b634ab3bbf4d840e8b995b5120f30c42c48f3d8..d13046305a28e1fb08eff56fff3a2b960c9f3010 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::
@@ -2720,7 +2722,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 ec2dbec2c9c0f97c75bef0f07045b1e26ea35422..d1f133f40de933de2e0585cb5cab12d1501c8bfd 100644 (file)
@@ -103,7 +103,6 @@ decorator is supported::
     from sqlalchemy.orm import mapped_column
     from sqlalchemy.orm import registry
 
-
     reg = registry()
 
 
@@ -122,7 +121,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()
 
 
@@ -173,7 +171,6 @@ the decorator directly::
     from sqlalchemy.orm import Mapped
     from sqlalchemy.orm import mapped_column
 
-
     reg = registry()
 
 
index 9064a4da695ac73012cd8f1bfd1afff3af840e42..6a6781b26c0f6b42e64c8b6c6c0c60008c629f9b 100644 (file)
@@ -1105,7 +1105,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,
@@ -2226,7 +2225,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 eed7b497a9514582b0aca1f12c5708b87606f4b2..a6d543da3c4bd4ae6b8ab37ef4cae0abb4c68bb6 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 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 3ad714921c84622e4e23917d9eba8463c11197da..64ce592407c8bbba0447cc04eb56223b0891f326 100644 (file)
@@ -46,7 +46,6 @@ from .base import VARCHAR
 from .base import XML
 from ...sql import try_cast
 
-
 base.dialect = dialect = pyodbc.dialect
 
 
index 1dda1e9dc6c5287daedcb250b48dbe00a0d909be..e6c7ceda700e750f05d5828a8e6537a10e6b8d6a 100644 (file)
@@ -3271,8 +3271,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'
@@ -3283,10 +3282,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 "
@@ -3484,8 +3480,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,
@@ -3505,8 +3500,7 @@ where
     and ind.type != 0
 order by
     ind.name
-                """
-            )
+                """)
             .bindparams(
                 sql.bindparam("tabname", tablename, ischema.CoerceUnicode()),
                 sql.bindparam("schname", owner, ischema.CoerceUnicode()),
@@ -3534,8 +3528,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,
@@ -3555,8 +3548,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()),
@@ -3982,8 +3974,7 @@ order by
     ):
         # Foreign key constraints
         s = (
-            text(
-                """\
+            text("""\
 WITH fk_info AS (
     SELECT
         ischema_ref_con.constraint_schema,
@@ -4083,8 +4074,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 07b9eef60be93676eae58c5fc80375581818ca32..f1bfbb5679407cfad277e4bf64b31968d4fa4dda 100644 (file)
@@ -357,7 +357,6 @@ hook. See that method for usage examples.
 
 """  # noqa
 
-
 import datetime
 import decimal
 import re
index 09db0d7b48f685aed5c9a4585c80522dc2bb4762..19c59d18d0c1380b766d6ce20d56c38b6af03dba 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 a7fa2f7d78010d1ea4cdbfeb9bcd1532c575354f..b46d9cecd865afa887132f0397bbfd417a78808b 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 908d1b5cb0e8804d82fee818ac45aa9f9de1f05e..17978e574e3eb5920081079bd9d1bc29cf24e560 100644 (file)
@@ -1062,6 +1062,7 @@ output:
     )
 
 """  # noqa
+
 from __future__ import annotations
 
 from collections import defaultdict
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 fc26974b8223e73f405a807516cd0fdac9d660b1..2c17b7b5f93a90e08ce7200c6f64437800468134 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 6ace9bb3030774e29b6f5596e7586e0318eb7048..f8ba689b0a156d77cbd7b8866fecb9a632dfbd26 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 bdcc5c010d541ac495e4c76efbf48b7ee22d46cf..c45d9bf49f82a45f888afd69114f8c09f6ba0048 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 a9be4ed41409fe0f0a8670cdddac8481725e13c4..2b8d65bf180330941af7cb0c15ba352f94b7ef95 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 8198f8c7da22a40089a9a95b6671ba19955e0351..bca724eb25c80860bfe125ecea7e4ac210afbef5 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 bf72ec02e4cd097bf4528356c57ed98e201a8bef..d5ac03a51320f8943c35d3bc9cb270376bf4ab68 100644 (file)
@@ -368,7 +368,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 6a1c86cb8932992f1bfb8b9495690b3399891a8f..83491e111d4ede34531b95b7ac870259a2a6343d 100644 (file)
@@ -467,6 +467,7 @@ SQL statements that are not otherwise associated with a :class:`.Numeric`
 SQLAlchemy type (or a subclass of such).
 
 """  # noqa
+
 from __future__ import annotations
 
 import decimal
index 51e9ba872eaa14b27a663cba07b67d9ffabbf1f0..b4c528cae103e36176b9ea477ed429f11b88280f 100644 (file)
@@ -17,7 +17,6 @@ from ...sql.base import _NoArg
 from ...sql.base import NO_ARG
 from ...sql.sqltypes import _T_JSON
 
-
 if TYPE_CHECKING:
     from ...engine.interfaces import Dialect
     from ...sql.type_api import _BindProcessorType
index 5ba4e0ae6cf77387cd52434853e60b037dfaf759..e76ca13c69c859e7c156afb0f1fa4bcbe9c33f21 100644 (file)
@@ -587,6 +587,7 @@ behavioral changes particularly when using the native JSON datatype.  See
 
 
 """  # noqa
+
 from __future__ import annotations
 
 import collections
index 66e439c7787860878c49027d8273038faf6c8911..f2cbe93102e72a38e88c7794676d7cf132c1f140 100644 (file)
@@ -316,12 +316,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 55dc41400cbda7a5c456d53bc55b7c96a1426a2c..76b2f488fa99eb4eef782603940515483d48fab9 100644 (file)
@@ -91,7 +91,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 91666e71ceaed4c30d8e36e4c37827f1ce20c9a2..738c27814a30b93af4435c94575faa331d5bcd97 100644 (file)
@@ -22,7 +22,6 @@ from ... import types as sqltypes
 from ...sql import functions as sqlfunc
 from ...types import OperatorClass
 
-
 __all__ = ("HSTORE", "hstore")
 
 _HSTORE_VAL = dict[str, str | None]
index 2eb4f43138e592d7a7a64454516ca7c430ba9d01..562eb821e91b28cbb219fba87446e802aad0dc08 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 93cd7e156c23b1e2ccf20b5be40ebddc88a7f48a..fc1e65e66de77121f12d2f63ed66dd8b717efa4d 100644 (file)
@@ -95,6 +95,7 @@ of the :ref:`psycopg2 <psycopg2_isolation_level>` dialect:
 
 
 """  # noqa
+
 import decimal
 import re
 
@@ -588,11 +589,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 5422849e82d3f26b60b8d3880c3c96c485cd2e69..46d7bbf5b5d8e42bf0cb5a85d1c43e24f1d27deb 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
 
 import collections
index bde9e1c93e6c4cca8c5dd4a7eeb3f8b47da2eeea..6035c79ed99cd9a2e880dfdf525e3ec8ca390394 100644 (file)
@@ -483,6 +483,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 0353b39e8280b483313d40476bf88a7521b1bb9e..5be6aa3a6384e07e1a79b6aea2adf03558f58da9 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 c37bcbb374ca444f4c32af5a68e612697515a96b..a1c4cc8d355004ea587b0465a749710ed834984a 100644 (file)
@@ -844,13 +844,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
     ]
@@ -885,13 +883,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
@@ -984,6 +980,7 @@ passed to methods such as :meth:`_schema.MetaData.reflect` or
     documentation.
 
 '''  # noqa
+
 from __future__ import annotations
 
 import datetime
@@ -2595,7 +2592,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 366ca2e4600d538111d95e11a22cbd5c5f51dfcf..01ec141ad2cf9101d43badc8f827ceb510701d79 100644 (file)
@@ -390,6 +390,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 7f8af56a8c4c41b18dfae10e7e5732097c4b8cc5..ba69b471d2b8d863e1c6f4d21abba837c4a1c63b 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 47a7a510d7e426f1fd0d5ed4f5050b65b1e8ae10..08d8ffe09eefb012ec2cb09a32321346b078e0ac 100644 (file)
@@ -615,7 +615,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", {}))
 
     # look for existing pool or create
index ef264ec559a285aeebf7ab5593a0bee6526f22b4..1fd66aa9ee7a060fa3032ecc9d73fb23edb21e38 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 TupleAny
 from ..util.typing import TypeVarTuple
 from ..util.typing import Unpack
 
-
 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 19ab95d3210464a354ae63aaaa76cd7b40d9972d..9d43059cbc7f60e26f3aad8fb1a3fef87a4297d0 100644 (file)
@@ -12,6 +12,7 @@ processors.
 They all share one common characteristic: None is passed through unchanged.
 
 """
+
 from __future__ import annotations
 
 import datetime
index 21ea03463e772c7fa3793874f3893bd08fd66c0a..48418f2fe95352be59c83838391d50ea1fe7f2b5 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 08cf350d280bc3535f003336925de606bfe6e1ce..8616b9b79a697998cee9eeea9f47b04324bd1add 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 c4601b9d6babc59f05034b70a31fc266c49d4e39..3db364887d54f0091d76fbc264b8e5b3d93137a6 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 78e041b95aa227bca08ca13ea2dab98aeea18086..ed400aa9a7e69127572223113c869666b363cf29 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 a8d794f897f995a4da8a3ea239c3a864daf27fc7..ff42bc9dcb164dd2646d838672a2ab2763bcc891 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 722f3d6b3c1e448cef1455c7c8d672e743482113..595e49d613020d3960bc8b0940b107c1e48cf2ee 100644 (file)
@@ -193,7 +193,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 69c98c57bbe13cc46e5be44a11361525d0f01b2b..82e8c06eac0ca7bca1f30aaaabcd06cf574f5598 100644 (file)
@@ -45,7 +45,6 @@ from ...util.typing import TupleAny
 from ...util.typing import TypeVarTuple
 from ...util.typing import Unpack
 
-
 if TYPE_CHECKING:
     from .engine import AsyncConnection
     from .engine import AsyncEngine
index 35af5ed8d2b246b56a8440dbd5fc0de28d2aa84e..99b5090d678221ec89af3da615296dc530a1245f 100644 (file)
@@ -710,6 +710,7 @@ be applied as::
 
 
 """  # noqa
+
 from __future__ import annotations
 
 import dataclasses
index fd88556c83625de799997ab969f60811162e3ea2..89a679ba513aeab909718bbbe8b0dc39ead8fb65 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 7b5c81b3919fc8f351f5484fb676635acdb8e38b..659e3a3dae284cc925b2c55df72ec44ceee335d9 100644 (file)
@@ -8,6 +8,7 @@
 
 
 """Public API functions and helpers for declarative."""
+
 from __future__ import annotations
 
 import collections
index 02cdd66d6986e3453f67843b4bbc5254c33b2af3..3fafda9b4d90f586479ad1fbb0d92155e6f6c322 100644 (file)
@@ -23,6 +23,7 @@ the source distribution.
 
 
 """
+
 from __future__ import annotations
 
 from typing import Any
@@ -54,7 +55,6 @@ from ..util.typing import TupleAny
 from ..util.typing import TypeVarTuple
 from ..util.typing import Unpack
 
-
 if TYPE_CHECKING:
     from ..engine.base import Connection
     from ..engine.base import Engine
index 392201dbcd31d5924c037441cdc990ef31aa3f6a..c42e2bdd2540d4c3417f990fd68927ab436a2319 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 83a3e5c46299a63537634176c26a0e0e293b91f8..dfe34d917db5bb8faa1ca525b7721e8cfdb95218 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 68126dad2a10b3455a625aefdcd30d213193927c..e4252cb503d5285be002bebd7e9f3b20f57ed686 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 03dbb59412761867998402062fc99bca8b0beec0..2758a527bd806b92f623404c3c85f7f10d7ee6d3 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 65919c982c8a5c305cbde2bd6449bce062c2a80b..7250d73ba5450bfebf55711026ed5aa71bef4647 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
@@ -32,7 +33,6 @@ from typing import Union
 
 from .util import py311
 
-
 STACKLEVEL = True
 # needed as of py3.11.0b1
 # #8019
index 4425962379d39f8b846ac978bbe1bb899f05dc5a..19eb3ddbfc037072786768e20aca9e8b33b835f4 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 d5c20f0d008e58003f64fc4c900578ffefc025f7..d09956537d72175c7376039a341e492d22c217e4 100644 (file)
@@ -2702,7 +2702,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 2c6158dd3fc257f39e4e8425a4de3bb6fbe8b679..3abe01d7031cd26a68c350f8525cb98d7201f888 100644 (file)
@@ -194,7 +194,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 ae810de388e11027ff18d8ba46623c14267bf481..47b046988463b3933e6b6546360bf267d85072ef 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
@@ -63,7 +64,6 @@ from ..util.typing import is_union
 from ..util.typing import TupleAny
 from ..util.typing import Unpack
 
-
 if typing.TYPE_CHECKING:
     from ._typing import _InstanceDict
     from ._typing import _RegistryType
index b7ed1c9399d88c72e17290dfc2ac483386aaa650..71fd0f0065bee06bab6e51f3e3ee7b08006573d5 100644 (file)
@@ -45,7 +45,6 @@ from .writeonly import WriteOnlyHistory
 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 c97c3d94454839d4317af7b66e58e88c25a198d0..10438a0bcf3173397b92a0b0029a4389937ef4e1 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 6f734e8b862c65483872fd20b171049cefa28c3c..e32bfa4914c585ea4bc953f1f9eef466ee340dbb 100644 (file)
@@ -23,7 +23,6 @@ alternate instrumentation forms.
 
 """
 
-
 from __future__ import annotations
 
 from typing import Any
index b17fb0af127a91c62f072c297c1b2f001db4b32e..9e8ec5dae2204aa28b9ff383753f5728fa05979a 100644 (file)
@@ -77,7 +77,6 @@ from ..util.typing import RODescriptorReference
 from ..util.typing import TupleAny
 from ..util.typing import Unpack
 
-
 if typing.TYPE_CHECKING:
     from ._typing import _EntityType
     from ._typing import _IdentityKeyType
index ad7fabb0f83664be54412c0c027f3c05b4e2f48b..73b5bce29b3ee288e87aa922acccbaf6dab255fd 100644 (file)
@@ -112,7 +112,7 @@ def instances(
     )
 
     try:
-        (process, labels, extra) = list(
+        process, labels, extra = list(
             zip(
                 *[
                     query_entity.row_processor(context, cursor)
@@ -560,7 +560,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 22528a4240261e1d5c8338b3c6762a6a1eb4acfe..71bb4592945850ccf4981a1cf4920fde31c58622 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 674ac91dbea933b2754a230514a4c7126222ad8c..7037a6b2d7c376fca005bb1046c978eeaa24c1f0 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 bb3d769424368789504af795f3570e77d1d46637..e6314b5b3ddfe3564d7cbc92f3c1a13180fd30a8 100644 (file)
@@ -950,10 +950,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 38ee0297c3755953a54eb2fc83147f01ab71ecdc..613625400c0c67e2e06a34a3f1c332d895a2d753 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
@@ -99,7 +100,6 @@ from ..util.typing import TupleAny
 from ..util.typing import TypeVarTuple
 from ..util.typing import Unpack
 
-
 if TYPE_CHECKING:
     from ._typing import _EntityType
     from ._typing import _ExternalEntityType
index 894cde4936af35141c8ea5392630d73326a25204..22100e9ea6051a31fbd08c98e0ad720391d65f1d 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 0aa6458f97dff8f41d3fca87c4e30f367ac1dbd7..a3be009fec469d5d3fdde838253e623f91205f7f 100644 (file)
@@ -96,7 +96,6 @@ from ..util.typing import TupleAny
 from ..util.typing import TypeVarTuple
 from ..util.typing import Unpack
 
-
 if typing.TYPE_CHECKING:
     from ._typing import _EntityType
     from ._typing import _IdentityKeyType
@@ -4935,7 +4934,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 3dfbc58ebd11d6e3fac4eeaced308898ad51461b..bf63aff9da4348f480837baff8fa670eae994485 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
@@ -523,7 +522,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)
@@ -609,7 +608,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 2807acfd7e25ffbc1a97fc48c9fc17fdf2ccec63..f8dd82a48fffac70919e2dd245a0b4b9c29a776e 100644 (file)
@@ -7,6 +7,7 @@
 
 
 """Pool implementation classes."""
+
 from __future__ import annotations
 
 import threading
index 06ea37900f201ff5cebe82e77c940d969d30831c..f5f602dbcdc95c0e06c4bd6ab55e65414de2feae 100644 (file)
@@ -11,7 +11,6 @@ are meaningful to the ORM.
 
 """
 
-
 from __future__ import annotations
 
 from typing import Literal
index 7272bfefc3874e5f2796466a0bd4d94eea9691ff..6b254d33f69627baf3cd0c09e8c3d60583aadc7b 100644 (file)
@@ -119,9 +119,9 @@ class anon_map(Dict[_AM_KEY, _AM_VALUE]):
             self_dict: dict = self  # type: ignore[type-arg]
 
             if key in self_dict:
-                return self_dict[key]  # type:ignore[no-any-return]
+                return self_dict[key]  # type: ignore[no-any-return]
             else:
-                return self._add_missing(key)  # type:ignore[no-any-return]
+                return self._add_missing(key)  # type: ignore[no-any-return]
 
     def __missing__(self: anon_map, key: _AM_KEY, /) -> int:
-        return self._add_missing(key)  # type:ignore[no-any-return]
+        return self._add_missing(key)  # type: ignore[no-any-return]
index 56bde75a127b45bac8b5e1d0986ae4262818a6f6..6f321c2cdd360d35d5610678abcc1570250dd637 100644 (file)
@@ -8,7 +8,6 @@
 
 """Foundational utilities common to many sql modules."""
 
-
 from __future__ import annotations
 
 import collections
index b8781d00bab6ffed3b69a33254802d85cc9f78d0..4014fbf40baa288c0c92bb38377cadb4517a4edc 100644 (file)
@@ -23,6 +23,7 @@ To generate user-defined SQL strings, see
 :doc:`/ext/compiler`.
 
 """
+
 from __future__ import annotations
 
 import collections
@@ -2196,7 +2197,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 66bd494eae708c6e3516b983d99268bf90dcf811..793e465e0d1053591168f760cebf3119f2de0986 100644 (file)
@@ -10,6 +10,7 @@
 within INSERT and UPDATE statements.
 
 """
+
 from __future__ import annotations
 
 import functools
@@ -911,7 +912,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 45e62848b71934ea7a350dd237e50d0b7278ff49..be40cdf8774e23e3dfd9b8fa61682f870770a5df 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
@@ -46,7 +47,6 @@ from .. import util
 from ..util import topological
 from ..util.typing import Self
 
-
 if typing.TYPE_CHECKING:
     from .compiler import Compiled
     from .compiler import DDLCompiler
index 2dbdf2bc16385023bdf807c167b9268b064e5bdc..d44a5d5e14e4bdb9755121ebe58f63fe25ded848 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
@@ -76,7 +77,6 @@ from ..util.typing import TupleAny
 from ..util.typing import TypeVarTuple
 from ..util.typing import Unpack
 
-
 if TYPE_CHECKING:
     from ._typing import _ColumnExpressionArgument
     from ._typing import _ColumnsClauseArgument
index 12b9eeefb7fa6527e1c9a7f3fe75a43814ffae91..acfeadced6cd9378f8efa0e87868a4c3ad67a90f 100644 (file)
@@ -86,7 +86,6 @@ from ..util.typing import Self
 from ..util.typing import TupleAny
 from ..util.typing import Unpack
 
-
 if typing.TYPE_CHECKING:
     from ._typing import _ByArgument
     from ._typing import _ColumnExpressionArgument
index 06e20c1a4e5db144feca8e7a5bdbe9413422c0c7..90efdc424146c4d7db2f0df8effe538f02ca7ec0 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 497e797e1a72f910bf8a6bae57a7adb1ade3e003..38fa97b0e36297336bee645c2f21af9fa8e8bc27 100644 (file)
@@ -45,7 +45,6 @@ from .. import exc
 from .. import inspection
 from .. import util
 
-
 if TYPE_CHECKING:
     from .elements import BindParameter
     from .elements import ClauseElement
@@ -302,7 +301,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 ab309765a3a900d5daa90f0dd5b84c8242677c1c..14958cc27b2d47db6e97e75238d048c760ad062a 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
@@ -2632,11 +2633,9 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T], Named[_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 eb09cfa3a667c4bf0d40da219e53176ec63f6b71..cc29ebdbec7a0395e99fc3e256ea3af811474c56 100644 (file)
@@ -5221,7 +5221,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 48c5b00d7e093e1ca84ebde8105f4a8d1e5d95fb..c5a11f5dbd8aecaf3dd0627e953867e0ed010a02 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
@@ -3798,7 +3799,6 @@ class Uuid(Emulated, TypeEngine[_UUID_RETURN]):
         from sqlalchemy import Uuid
         from sqlalchemy import Table, Column, MetaData, String
 
-
         metadata_obj = MetaData()
 
         t = Table(
index efa39eab636ae3b6db01b2a9b95cb4b445b98bf9..99d3219c10ff598ba58778bd129f73d08eb1ed62 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 652a73d88db4058203f0ba1b62c6060617e78001..9b129ae49927ae43c8b4cd940280469e04449ef3 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
@@ -864,7 +865,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 80a337689701ab3083d8f6b30ae5a8f20a4273b1..288f1b76f785599bd97084734984f8a851dffc94 100644 (file)
@@ -27,7 +27,6 @@ from .. import event
 from .. import pool
 from ..util import await_
 
-
 if typing.TYPE_CHECKING:
     from ..engine import Engine
     from ..engine.url import URL
index c712c9e46057a60f973090ce3f4a3b26d22b812d..44576b2a16048092e4450fab23e1336eff5f5557 100644 (file)
@@ -50,8 +50,7 @@ class MypyTest(TestBase):
             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}
@@ -59,8 +58,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 a4262f38b4fad12b670a70b7bf796fb2e5eba433..391b24576b140b58950060f4d16fde1a20ce1c57 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 0f53db64631bf94ee9739b176d0dc7c524408186..a283419d3af8086a75013b5bc6187f14828604da 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 13722beb69296e4aea392f6ce11298eed572967c..4374622c5ab2f6104faa8da859e0bfa0777a6b36 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 0872072f7c1cd78b604c5c06a0806595b3cfdc4f..53e130b8c5d94cb37a786f420cf647b4f9846821 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 db46c63c12ce3c746fbecf4a8531b7e518fab409..67567992b4eed22ad0b858a9aa753fdb7fda7fd8 100644 (file)
@@ -7,7 +7,6 @@
 
 """Compatibility namespace for sqlalchemy.sql.types."""
 
-
 from __future__ import annotations
 
 from .sql.operators import OperatorClass as OperatorClass
index 432d68e3f31a844fcbd4a58e9bdb11a1e9451655..2034d92a2359897e3094627b73c6736fede1d7e5 100644 (file)
@@ -7,6 +7,7 @@
 # mypy: allow-untyped-defs, allow-untyped-calls
 
 """Collection classes and helpers."""
+
 from __future__ import annotations
 
 import operator
@@ -45,7 +46,6 @@ from ._immutabledict_cy import ImmutableDictBase as ImmutableDictBase
 from ._immutabledict_cy import ReadOnlyContainer as ReadOnlyContainer
 from .typing import is_non_string_iterable
 
-
 _T = TypeVar("_T", bound=Any)
 _KT = TypeVar("_KT", bound=Any)
 _VT = TypeVar("_VT", bound=Any)
index 50a22026f213dcaf31682b921f5d0faf2f5062fc..fdf539f7bb8fe0e2a420e69dcaebe5822bd0da53 100644 (file)
@@ -10,6 +10,7 @@
 modules, classes, hierarchies, attributes, functions, and methods.
 
 """
+
 from __future__ import annotations
 
 import collections
@@ -318,21 +319,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,
@@ -1654,9 +1649,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
@@ -1956,7 +1955,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 b6350b88b6ca7d0acdfe43e6b84c7a66ce1760cc..04509f98dd5e6d3d123b468ab55dc3a560ca76f8 100644 (file)
@@ -10,6 +10,7 @@
 runtime.
 
 """
+
 from __future__ import annotations
 
 import sys
index 2e543df2d64e6ac16139ae652a0bba56cb7c97b6..7547cad5c97cdb94c2635be8ea852fa721fd9cd0 100644 (file)
@@ -18,6 +18,7 @@ producing a ``put()`` inside the ``get()`` and therefore a reentrant
 condition.
 
 """
+
 from __future__ import annotations
 
 import asyncio
@@ -33,7 +34,6 @@ from typing import TypeVar
 from .concurrency import await_
 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 9c03972be54c6d2339578756403b8d246df1e9d9..1c043ecd505e8b882628eb2a01cb30cb51baeb22 100644 (file)
@@ -185,7 +185,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 5c6ef2b1dddc2e57fc03eaf0f2a1de198a44b40f..84527826fdb4ac222aaa85f4c2fd8cf29eba89a0 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 4ccdd29b2d19fb3f279f6e53787114fa5e05a9ef..754478c9823365f05c532f5d941031da3f48f62e 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 90597d8882cd089d637a433fd09226d0899739fe..5a24c3c08cf9818d73f9b50ca7524482c5adc2a3 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 ce642b00ef67e8f1e247532da0f0e04148ff9bb3..63e2c4e4c02ff64a2d46e6bbf595da29c783002c 100644 (file)
@@ -457,20 +457,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(
@@ -628,8 +624,7 @@ class TableValuedTest(fixtures.TestBase):
 
     @testing.fixture
     def scalar_strings(self, connection):
-        connection.exec_driver_sql(
-            """
+        connection.exec_driver_sql("""
 
 CREATE FUNCTION scalar_strings (
 )
@@ -641,15 +636,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
@@ -660,8 +653,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 2b6bd5f5bf813ad38643d59ee3a0dd024375e866..1cc41e453f104a7bf9f777d874f94fecbfc20a9c 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(
@@ -1108,8 +1106,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
@@ -1126,31 +1123,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
@@ -1161,8 +1152,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 265857e01398d401a0a1f3700c8a387beef859a4..70708857b77fbd0f44a22f829ebc90a45a26c671 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)
 
@@ -782,9 +776,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}
@@ -1034,20 +1026,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 = [
             {
@@ -1172,13 +1158,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 57e795ad3affbd4dadbfeea2ad5ad12f40330771..fa1fb457dbd0df6cf2b736f278eb3bd45314cfcd 100644 (file)
@@ -1719,34 +1719,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 = [
             {
@@ -1890,28 +1884,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()
@@ -2176,19 +2164,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 5118687485a1ae1451512e5ee46ebd38da0a3fb9..1673916c61812048bd8c430315bae2037307d1fa 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 ab5cdccd8b59c7bb221cbbef1be56c7967506d2d..d61937f96497a6caa24bc0191e9cfa839894a5e5 100644 (file)
@@ -478,10 +478,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 403d2dd41ca6b71979f4995fd1e9b15daf560090..3eb32e6670da76a07873dbcbfe9528e5c6199172 100644 (file)
@@ -403,7 +403,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 c56d2cafc27aeb6e52f153730a19692975dd7d19..60cd3f14aecc1838734b17b7b645cebf6643a80c 100644 (file)
@@ -70,7 +70,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 e01805ce70d346f3f84645451e5a5c3c0526510a..2c027642b74aa1984fb33538f596330968d9fcb9 100644 (file)
@@ -103,7 +103,6 @@ from sqlalchemy.testing import Variation
 from sqlalchemy.testing.assertions import ne_
 from sqlalchemy.testing.fixtures import fixture_session
 
-
 # try to differentiate between typing_extensions.TypeAliasType
 # and typing.TypeAliasType
 TypingTypeAliasType = getattr(typing, "TypeAliasType", TypeAliasType)
index d5d5298a9f80c4abddb33f9c28b61d9e4d077fbf..0d2c6cdc33ebc80d395e0846a3d6eaab67b14b25 100644 (file)
@@ -94,7 +94,6 @@ from sqlalchemy.testing import Variation
 from sqlalchemy.testing.assertions import ne_
 from sqlalchemy.testing.fixtures import fixture_session
 
-
 # try to differentiate between typing_extensions.TypeAliasType
 # and typing.TypeAliasType
 TypingTypeAliasType = getattr(typing, "TypeAliasType", TypeAliasType)
index bce3667e4bb2cb93f500c398b773f23009e5dbde..4310c49ec66bed00158035f026897bb7f7a0a712 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 c67269c6c7465af4e0a8e76851ec3fbbb69f32ba..a51192a9d5ea57098e683e84ae367f15733b62e4 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 2713b5572cb5fa2c25bd46002bf7616d0175d1c7..211ed8694d47559fcac39409aa4f4f329899812b 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 1dd703751564cc992bd285818334691e9b84116e..50eb4cf75c76f5b12c80f0b103f24dd1d6d078d7 100644 (file)
@@ -118,7 +118,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 7d0bf5c2411c30a25f5228fe7911083bf73e3e23..b7969858ae2ab4c1acd13eab751f327b05a5b6bd 100644 (file)
@@ -65,7 +65,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 7762ab8637af81bae6208782f666d77ee4a87f00..0a0a738e53b8efd7b760ba71c06c21096abc567b 100644 (file)
@@ -1092,7 +1092,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"]),
             ),
@@ -1119,7 +1119,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"]),
             ),
@@ -1141,7 +1141,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 191ad6636984f7269e955b4c7e1f528ef84ba4d5..80c87da0f9414a648fc3c7b1418cbd5e11488f12 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 0660f44380163f8d9b0e81e11fe6fc5d11198e5a..cc6ed2e2b6f802c66628333e63134c330d500cdb 100644 (file)
@@ -7,7 +7,6 @@ from sqlalchemy.engine import Inspector
 from sqlalchemy.engine.base import Engine
 from sqlalchemy.engine.interfaces import ReflectedColumn
 
-
 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 8e959cea9859e493ed678302ab14629b0c8b3034..f597d60ff98636fb3b9d16910ccc868181720626 100644 (file)
@@ -15,7 +15,6 @@ from sqlalchemy.orm import Session
 from sqlalchemy.orm import sessionmaker
 from sqlalchemy.orm.query import Query
 
-
 async_engine = create_async_engine("...")
 
 
index 03d827ea7efd163f18495cf9f44ae92f95a23ffd..0f364fa71df54b5780af4dc6da2f34e8ffebd8c9 100644 (file)
@@ -16,7 +16,6 @@ from sqlalchemy import text
 from sqlalchemy import true
 from sqlalchemy import UUID
 
-
 m = MetaData()
 
 
index ef3b2dc390b5b223d8a103292d9e8e68f68d1553..e762d613ba93e23a6f0cbd135ce386429d068004 100644 (file)
@@ -21,7 +21,6 @@ from sqlalchemy.sql.elements import UnaryExpression
 from sqlalchemy.sql.expression import BinaryExpression
 from sqlalchemy.sql.expression import ColumnClause
 
-
 # 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 7240b7c0d58955c5e3c95ec976d561e42a3543e7..3e4c93e66fd3dd2ceb1afa93ef91c43c6285f29b 100644 (file)
@@ -9,7 +9,6 @@ from sqlalchemy import Select
 from sqlalchemy import select
 from sqlalchemy.sql.sqltypes import _JSON_VALUE
 
-
 assert_type(Float(), Float[float])
 assert_type(Float(asdecimal=True), Float[Decimal])
 
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 95bb1a4180fcb157aade8c29d49a5c3d9c522f79..174f6d541a91283feaff99c55f29f53d7f7b0281 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 484e4055dbeb0b82094ba26aff5c75315547077b..4aa5facea5fe8929526d3a3c44b8f0377fd90c24 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