]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update flake8 noqa skips with proper syntax
authorFederico Caselli <cfederico87@gmail.com>
Mon, 11 Apr 2022 20:21:20 +0000 (22:21 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 11 Apr 2022 20:48:23 +0000 (22:48 +0200)
Change-Id: I42ed77f559e3ee5b8c600d98457ee37803ef0ea6

48 files changed:
lib/sqlalchemy/connectors/pyodbc.py
lib/sqlalchemy/dialects/oracle/provision.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/cursor.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/event/base.py
lib/sqlalchemy/event/legacy.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/log.py
lib/sqlalchemy/orm/base.py
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/pool/base.py
lib/sqlalchemy/pool/events.py
lib/sqlalchemy/sql/_selectable_constructors.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/crud.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/util/_collections.py
lib/sqlalchemy/util/_concurrency_py3k.py
lib/sqlalchemy/util/_py_collections.py
lib/sqlalchemy/util/concurrency.py
lib/sqlalchemy/util/langhelpers.py
lib/sqlalchemy/util/typing.py
test/aaa_profiling/test_orm.py
test/dialect/oracle/test_reflection.py
test/ext/mypy/plugin_files/ensure_descriptor_type_fully_inferred.py
test/ext/mypy/plugin_files/ensure_descriptor_type_noninferred.py
test/ext/mypy/plugin_files/ensure_descriptor_type_semiinferred.py
test/ext/mypy/plugin_files/invalid_noninferred_lh_type.py
test/ext/mypy/plugin_files/typeless_fk_col_cant_infer.py
test/ext/mypy/test_mypy_plugin_py3k.py
test/orm/declarative/test_typed_mapping.py
test/orm/test_deprecations.py
test/sql/test_functions.py

index 59951cd041379f35f96e22cf040e22096ec05ded..c24fa344b24dc746184d869a86e33c4e557834d1 100644 (file)
@@ -180,7 +180,7 @@ class PyODBCConnector(Connector):
         dbapi_con = connection.connection.dbapi_connection
         version: Tuple[Union[int, str], ...] = ()
         r = re.compile(r"[.\-]")
-        for n in r.split(dbapi_con.getinfo(self.dbapi.SQL_DBMS_VER)):  # type: ignore[union-attr]  # noqa E501
+        for n in r.split(dbapi_con.getinfo(self.dbapi.SQL_DBMS_VER)):  # type: ignore[union-attr]  # noqa: E501
             try:
                 version += (int(n),)
             except ValueError:
@@ -215,7 +215,7 @@ class PyODBCConnector(Connector):
     def get_isolation_level_values(
         self, dbapi_connection: interfaces.DBAPIConnection
     ) -> List[_IsolationLevel]:
-        return super().get_isolation_level_values(dbapi_connection) + [  # type: ignore  # noqa E501
+        return super().get_isolation_level_values(dbapi_connection) + [  # type: ignore  # noqa: E501
             "AUTOCOMMIT"
         ]
 
index 8ce58782be0c761165a1191aa7a6ab6e0d79cf42..74ad1f2a4b1223e0d7e19a8097c7c12bef3e5675 100644 (file)
@@ -63,7 +63,7 @@ def stop_test_class_outside_fixtures(config, db, cls):
     try:
         with db.begin() as conn:
             # run magic command to get rid of identity sequences
-            # https://floo.bar/2019/11/29/drop-the-underlying-sequence-of-an-identity-column/  # noqa E501
+            # https://floo.bar/2019/11/29/drop-the-underlying-sequence-of-an-identity-column/  # noqa: E501
             conn.exec_driver_sql("purge recyclebin")
     except exc.DatabaseError as err:
         log.warning("purge recyclebin command failed: %s", err)
index 99945280491eed50535e8f989690a91abba8f471..503bcc03bc0d31c165f85e62666414302331720f 100644 (file)
@@ -1421,7 +1421,7 @@ E.g.::
     )
 
 
-"""  # noqa E501
+"""  # noqa: E501
 
 from collections import defaultdict
 import datetime as dt
index ad31585fb20ec876878ef4ec2db5043c68acd399..4399c68fc4ba1ac6ed1e3444c79f096c1745a62f 100644 (file)
@@ -2655,7 +2655,7 @@ class Engine(
             :meth:`_engine.Engine.get_execution_options`
 
 
-        """  # noqa E501
+        """  # noqa: E501
         return self._option_cls(self, opt)
 
     def get_execution_options(self) -> _ExecuteOptions:
index 4f151e79ccac90673a75a70142e32d252c9cf506..72102ac264fe77e3acffcfb8acb229a4a1b493a5 100644 (file)
@@ -1637,7 +1637,7 @@ class CursorResult(Result):
 
             :ref:`tutorial_update_delete_rowcount` - in the :ref:`unified_tutorial`
 
-        """  # noqa E501
+        """  # noqa: E501
 
         try:
             return self.context.rowcount
index 05b06e84651f7463cf3fb5521507157326715d01..dee80e13fdbe2c80d7f98319d93d9335f0caa19f 100644 (file)
@@ -502,7 +502,7 @@ class ResultInternal(InPlaceGenerative):
                     )
                     for made_row in made_rows
                 ]
-                if sig_row not in uniques and not uniques.add(sig_row)  # type: ignore # noqa E501
+                if sig_row not in uniques and not uniques.add(sig_row)  # type: ignore # noqa: E501
             ]
         else:
             interim_rows = made_rows
@@ -749,7 +749,7 @@ class ResultInternal(InPlaceGenerative):
         real_result = self._real_result if self._real_result else self
 
         if (
-            real_result._source_supports_scalars  # type: ignore[attr-defined] # noqa E501
+            real_result._source_supports_scalars  # type: ignore[attr-defined] # noqa: E501
             and len(indexes) == 1
         ):
             self._generate_rows = False
index 4174b1dbeaf611486e85469611c011424187fee4..8ed4c64bac4fc05caf8d646f1bc53b2f6dd29a45 100644 (file)
@@ -319,7 +319,7 @@ class _HasEventsDispatch(Generic[_ET]):
             assert dispatch_target_cls is not None
             if (
                 hasattr(dispatch_target_cls, "__slots__")
-                and "_slots_dispatch" in dispatch_target_cls.__slots__  # type: ignore  # noqa E501
+                and "_slots_dispatch" in dispatch_target_cls.__slots__  # type: ignore  # noqa: E501
             ):
                 dispatch_target_cls.dispatch = slots_dispatcher(cls)
             else:
index 75e5be7fe08d14a1a901ff68fd48c6f727cf1f80..8ae9b7035239b1574db064e221c61c7894fb3549 100644 (file)
@@ -51,7 +51,7 @@ def _legacy_signature(
     def leg(fn: Callable[..., Any]) -> Callable[..., Any]:
         if not hasattr(fn, "_legacy_signatures"):
             fn._legacy_signatures = []  # type: ignore[attr-defined]
-        fn._legacy_signatures.append((since, argnames, converter))  # type: ignore[attr-defined] # noqa E501
+        fn._legacy_signatures.append((since, argnames, converter))  # type: ignore[attr-defined] # noqa: E501
         return fn
 
     return leg
index 194eabb64ebf90933caba2018a577ce60077b264..5ea268a2dd713b8957328580b532a31d5f3b6134 100644 (file)
@@ -1176,7 +1176,7 @@ class ObjectAssociationProxyInstance(AssociationProxyInstance[_T]):
                 **{self.value_attr: other}
             )
 
-    def __eq__(self, obj: Any) -> ColumnElement[bool]:  # type: ignore[override]  # noqa E501
+    def __eq__(self, obj: Any) -> ColumnElement[bool]:  # type: ignore[override]  # noqa: E501
         # note the has() here will fail for collections; eq_()
         # is only allowed with a scalar.
         if obj is None:
@@ -1187,7 +1187,7 @@ class ObjectAssociationProxyInstance(AssociationProxyInstance[_T]):
         else:
             return self._comparator.has(**{self.value_attr: obj})
 
-    def __ne__(self, obj: Any) -> ColumnElement[bool]:  # type: ignore[override]  # noqa E501
+    def __ne__(self, obj: Any) -> ColumnElement[bool]:  # type: ignore[override]  # noqa: E501
         # note the has() here will fail for collections; eq_()
         # is only allowed with a scalar.
         return self._comparator.has(
@@ -1203,7 +1203,7 @@ class ColumnAssociationProxyInstance(AssociationProxyInstance[_T]):
     _target_is_object: bool = False
     _is_canonical = True
 
-    def __eq__(self, other: Any) -> ColumnElement[bool]:  # type: ignore[override]  # noqa E501
+    def __eq__(self, other: Any) -> ColumnElement[bool]:  # type: ignore[override]  # noqa: E501
         # special case "is None" to check for no related row as well
         expr = self._criterion_exists(
             self.remote_attr.operate(operators.eq, other)
index 46c8f0baa77a07a1eba44b5093b03c0555ea90c8..8eca8c52480d264f2c6095248689d0ccaa8163b6 100644 (file)
@@ -85,7 +85,7 @@ class async_scoped_session(ScopedSessionMixin):
          the current scope.   A function such as ``asyncio.current_task``
          may be useful here.
 
-        """  # noqa E501
+        """  # noqa: E501
 
         self.session_factory = session_factory
         self.registry = ScopedRegistry(session_factory, scopefunc)
index 18b38ee0a0abc357395ab13dd323fb97aa312a4f..c39a8d6e0ad347772ff5fc4e1c572c9364ea75b5 100644 (file)
@@ -503,7 +503,7 @@ class AsyncSession(ReversibleProxy):
         blocking-style code, which will be translated to implicitly async calls
         at the point of invoking IO on the database drivers.
 
-        """  # noqa E501
+        """  # noqa: E501
 
         return self.sync_session.get_bind(
             mapper=mapper, clause=clause, bind=bind, **kw
index 2feade04eef8136f87fbfb6f681e18e1c224b92f..d463f5b9a3a3a5c6bc1dd61dcf9d8aa2aa82c80c 100644 (file)
@@ -64,10 +64,10 @@ def _qual_logger_name_for_cls(cls: Type["Identified"]) -> str:
 
 def class_logger(cls: Type[_IT]) -> Type[_IT]:
     logger = logging.getLogger(_qual_logger_name_for_cls(cls))
-    cls._should_log_debug = lambda self: logger.isEnabledFor(  # type: ignore[assignment]  # noqa E501
+    cls._should_log_debug = lambda self: logger.isEnabledFor(  # type: ignore[assignment]  # noqa: E501
         logging.DEBUG
     )
-    cls._should_log_info = lambda self: logger.isEnabledFor(  # type: ignore[assignment]  # noqa E501
+    cls._should_log_info = lambda self: logger.isEnabledFor(  # type: ignore[assignment]  # noqa: E501
         logging.INFO
     )
     cls.logger = logger
index cb30701037418555f20dbb1e4e0bdef23ee876dc..a1a9442dcaf2e814cd6001fbc96b45e3541d1b08 100644 (file)
@@ -616,7 +616,7 @@ class SQLORMOperations(SQLCoreOperations[_T], TypingOnly):
         def and_(self, *criteria):
             ...
 
-        def any(self, criterion=None, **kwargs):  # noqa A001
+        def any(self, criterion=None, **kwargs):  # noqa: A001
             ...
 
         def has(self, criterion=None, **kwargs):
index 4e28eeff7f95e6d81502fc18be5e4b087ceec917..4a699f63bbe41a6528f8a56dec4bca9033217510 100644 (file)
@@ -249,7 +249,7 @@ class declared_attr(interfaces._MappedAttribute[_T]):
         :ref:`orm_declarative_dataclasses_mixin` - illustrates special forms
         for use with Python dataclasses
 
-    """  # noqa E501
+    """  # noqa: E501
 
     if typing.TYPE_CHECKING:
 
index 16ab1f4c84c09e714ded4ee1a12c1383b241ecbd..6f4c654ce4ee9543d8e65505018462ef6a86289e 100644 (file)
@@ -757,7 +757,7 @@ def _instance_processor(
                         # test.orm.inheritance.test_basic ->
                         # EagerTargetingTest.test_adapt_stringency
                         # OptimizedLoadTest.test_column_expression_joined
-                        # PolymorphicOnNotLocalTest.test_polymorphic_on_column_prop  # noqa E501
+                        # PolymorphicOnNotLocalTest.test_polymorphic_on_column_prop  # noqa: E501
                         #
 
                         adapted_col = adapter.columns[col]
index 9ab1477100445bae4b60ad109c44fcfbcdb12097..e22848fd25b07e66cefa7baff7d1a2399dc24040 100644 (file)
@@ -269,7 +269,7 @@ class Pool(log.Identified, event.EventTarget):
 
         # mypy seems to get super confused assigning functions to
         # attributes
-        self._invoke_creator = self._should_wrap_creator(creator)  # type: ignore  # noqa E501
+        self._invoke_creator = self._should_wrap_creator(creator)  # type: ignore  # noqa: E501
 
     @_creator.deleter
     def _creator(self) -> None:
@@ -609,7 +609,7 @@ class _ConnectionRecord(ConnectionPoolEntry):
     dbapi_connection: Optional[DBAPIConnection]
 
     @property
-    def driver_connection(self) -> Optional[Any]:  # type: ignore[override]  # mypy#4125  # noqa E501
+    def driver_connection(self) -> Optional[Any]:  # type: ignore[override]  # mypy#4125  # noqa: E501
         if self.dbapi_connection is None:
             return None
         else:
@@ -632,7 +632,7 @@ class _ConnectionRecord(ConnectionPoolEntry):
         return {}
 
     @util.memoized_property
-    def record_info(self) -> Optional[Dict[str, Any]]:  # type: ignore[override]  # mypy#4125  # noqa E501
+    def record_info(self) -> Optional[Dict[str, Any]]:  # type: ignore[override]  # mypy#4125  # noqa: E501
         return {}
 
     @classmethod
@@ -1081,7 +1081,7 @@ class _AdhocProxiedConnection(PoolProxiedConnection):
         self._is_valid = False
 
     @property
-    def record_info(self) -> Optional[Dict[str, Any]]:  # type: ignore[override]  # mypy#4125  # noqa E501
+    def record_info(self) -> Optional[Dict[str, Any]]:  # type: ignore[override]  # mypy#4125  # noqa: E501
         return self._connection_record.record_info
 
     def cursor(self, *args: Any, **kwargs: Any) -> DBAPICursor:
@@ -1147,7 +1147,7 @@ class _ConnectionFairy(PoolProxiedConnection):
     _connection_record: Optional[_ConnectionRecord]
 
     @property
-    def driver_connection(self) -> Optional[Any]:  # type: ignore[override]  # mypy#4125  # noqa E501
+    def driver_connection(self) -> Optional[Any]:  # type: ignore[override]  # mypy#4125  # noqa: E501
         if self._connection_record is None:
             return None
         return self._connection_record.driver_connection
@@ -1322,7 +1322,7 @@ class _ConnectionFairy(PoolProxiedConnection):
             return self._connection_record.info
 
     @property
-    def record_info(self) -> Optional[Dict[str, Any]]:  # type: ignore[override]  # mypy#4125  # noqa E501
+    def record_info(self) -> Optional[Dict[str, Any]]:  # type: ignore[override]  # mypy#4125  # noqa: E501
         if self._connection_record is None:
             return None
         else:
index be2b406a344b31a67eba457cd7210d4a10a8902b..e961df1a3b69e83892fb11f1a7d9c3886922451d 100644 (file)
@@ -50,7 +50,7 @@ class PoolEvents(event.Events[Pool]):
         # will associate with engine.pool
         event.listen(engine, 'checkout', my_on_checkout)
 
-    """  # noqa E501
+    """  # noqa: E501
 
     _target_class_doc = "SomeEngineOrPool"
     _dispatch_target = Pool
index 7896c02c24b1e046a88952bfbeb1ffc6ce01290e..37d44976a278d9e4c1b9c84ece9579d720c9c195 100644 (file)
@@ -157,7 +157,7 @@ def exists(
         :meth:`_sql.SelectBase.exists` - method to transform a ``SELECT`` to an
         ``EXISTS`` clause.
 
-    """  # noqa E501
+    """  # noqa: E501
 
     return Exists(__argument)
 
index f766a5ac50756ac4c09b83823b1aa29f1b69c725..7fb9c260267e438be6cdfaafcc8549dc0e7d4aae 100644 (file)
@@ -1172,7 +1172,7 @@ class Executable(roles.StatementRole, Generative):
             :ref:`orm_queryguide_execution_options` - documentation on all
             ORM-specific execution options
 
-        """  # noqa E501
+        """  # noqa: E501
         if "isolation_level" in kw:
             raise exc.ArgumentError(
                 "'isolation_level' execution option may only be specified "
index f6db2c4b25837c4c5f912f888513b495ad13a5af..e4408cd31647007fffc2c4fb14796e1e1c34afc0 100644 (file)
@@ -430,7 +430,7 @@ def _key_getters_for_crud_column(
         _column_as_key = functools.partial(  # type: ignore
             coercions.expect_as_key, roles.DMLColumnRole
         )
-        _getattr_col_key = _col_bind_name = operator.attrgetter("key")  # type: ignore  # noqa E501
+        _getattr_col_key = _col_bind_name = operator.attrgetter("key")  # type: ignore  # noqa: E501
 
     return _column_as_key, _getattr_col_key, _col_bind_name
 
index f23ba2e6e2e3c27e16da8614665c246089156389..8307f64003fcee3a7fd82919b2c3424e9ae8f8a4 100644 (file)
@@ -453,7 +453,7 @@ class UpdateBase(
 
           :ref:`tutorial_insert_returning` - in the :ref:`unified_tutorial`
 
-        """  # noqa E501
+        """  # noqa: E501
         if self._return_defaults:
             raise exc.InvalidRequestError(
                 "return_defaults() is already configured on this statement"
@@ -610,7 +610,7 @@ class UpdateBase(
 
             :ref:`queryguide_inspection` - ORM background
 
-        """  # noqa E501
+        """  # noqa: E501
         meth = DMLState.get_plugin_class(
             self
         ).get_returning_column_descriptions
index 7ea09e7583abd3406060c1b56fcfd805d8feaeb2..805758283538e8a40d9212f6680ab6666e9ce185 100644 (file)
@@ -2668,11 +2668,11 @@ class BooleanClauseList(ClauseList, ColumnElement[bool]):
         if lcc > 1:
             # multiple elements.  Return regular BooleanClauseList
             # which will link elements against the operator.
-            return cls._construct_raw(operator, convert_clauses)  # type: ignore # noqa E501
+            return cls._construct_raw(operator, convert_clauses)  # type: ignore # noqa: E501
         elif lcc == 1:
             # just one element.  return it as a single boolean element,
             # not a list and discard the operator.
-            return convert_clauses[0]  # type: ignore[no-any-return] # noqa E501
+            return convert_clauses[0]  # type: ignore[no-any-return] # noqa: E501
         else:
             # no elements period.  deprecated use case.  return an empty
             # ClauseList construct that generates nothing unless it has
@@ -2689,7 +2689,7 @@ class BooleanClauseList(ClauseList, ColumnElement[bool]):
                 },
                 version="1.4",
             )
-            return cls._construct_raw(operator)  # type: ignore[no-any-return] # noqa E501
+            return cls._construct_raw(operator)  # type: ignore[no-any-return] # noqa: E501
 
     @classmethod
     def _construct_for_whereclause(
index db4bb583735924c88b2493fcb10aa5abf3922333..a66a1eb92991a0180ca20ab956e02bb9fe8aca83 100644 (file)
@@ -200,7 +200,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative):
 
             :meth:`_functions.FunctionElement.column_valued`
 
-        """  # noqa E501
+        """  # noqa: E501
 
         return ScalarFunctionColumn(self, name, type_)
 
@@ -270,7 +270,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative):
             :meth:`_sql.TableValuedAlias.render_derived` - renders the alias
             using a derived column clause, e.g. ``AS name(col1, col2, ...)``
 
-        """  # noqa 501
+        """  # noqa: 501
 
         new_func = self._generate()
 
@@ -311,7 +311,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative):
 
             :meth:`_functions.FunctionElement.table_valued`
 
-        """  # noqa 501
+        """  # noqa: 501
 
         return self.alias(name=name).column
 
@@ -336,7 +336,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative):
             :meth:`_functions.FunctionElement.table_valued` - generates table-valued
             SQL function expressions.
 
-        """  # noqa E501
+        """  # noqa: E501
         return self.c
 
     @util.ro_memoized_property
@@ -1197,19 +1197,19 @@ class coalesce(ReturnTypeFromArgs[_T]):
     inherit_cache = True
 
 
-class max(ReturnTypeFromArgs[_T]):  # noqa  A001
+class max(ReturnTypeFromArgs[_T]):  # noqa:  A001
     """The SQL MAX() aggregate function."""
 
     inherit_cache = True
 
 
-class min(ReturnTypeFromArgs[_T]):  # noqa A001
+class min(ReturnTypeFromArgs[_T]):  # noqa: A001
     """The SQL MIN() aggregate function."""
 
     inherit_cache = True
 
 
-class sum(ReturnTypeFromArgs[_T]):  # noqa A001
+class sum(ReturnTypeFromArgs[_T]):  # noqa: A001
     """The SQL SUM() aggregate function."""
 
     inherit_cache = True
index 7db1631c852d250f37042a56b22892f283dbdd29..ebc8a28cee81aedc4f9b7f341c2fd723c995c5ea 100644 (file)
@@ -417,7 +417,7 @@ class custom_op(OperatorType, Generic[_T]):
         if hasattr(left, "__sa_operate__"):
             return left.operate(self, right, *other, **kwargs)
         elif self.python_impl:
-            return self.python_impl(left, right, *other, **kwargs)  # type: ignore  # noqa E501
+            return self.python_impl(left, right, *other, **kwargs)  # type: ignore  # noqa: E501
         else:
             raise exc.InvalidRequestError(
                 f"Custom operator {self.opstring!r} can't be used with "
index 883439ca5324480544db34e67169062ac1a862f7..c9b67caca38610f905aa6dc882aefa0a946fa3f2 100644 (file)
@@ -683,10 +683,10 @@ class Table(DialectKWArgs, HasSchemaAttr, TableClause):
             by the SQLAlchemy dialect.
 
             .. note:: setting this flag to ``False`` will not provide
-            case-insensitive behavior for table reflection; table reflection
-            will always search for a mixed-case name in a case sensitive
-            fashion.  Case insensitive names are specified in SQLAlchemy only
-            by stating the name with all lower case characters.
+              case-insensitive behavior for table reflection; table reflection
+              will always search for a mixed-case name in a case sensitive
+              fashion.  Case insensitive names are specified in SQLAlchemy only
+              by stating the name with all lower case characters.
 
         :param quote_schema: same as 'quote' but applies to the schema identifier.
 
@@ -707,10 +707,10 @@ class Table(DialectKWArgs, HasSchemaAttr, TableClause):
             specify the special symbol :attr:`.BLANK_SCHEMA`.
 
             .. versionadded:: 1.0.14  Added the :attr:`.BLANK_SCHEMA` symbol to
-            allow a :class:`_schema.Table`
-            to have a blank schema name even when the
-            parent :class:`_schema.MetaData` specifies
-            :paramref:`_schema.MetaData.schema`.
+              allow a :class:`_schema.Table`
+              to have a blank schema name even when the
+              parent :class:`_schema.MetaData` specifies
+              :paramref:`_schema.MetaData.schema`.
 
             The quoting rules for the schema name are the same as those for the
             ``name`` parameter, in that quoting is applied for reserved words or
@@ -730,7 +730,7 @@ class Table(DialectKWArgs, HasSchemaAttr, TableClause):
             See the documentation regarding an individual dialect at
             :ref:`dialect_toplevel` for detail on documented arguments.
 
-        """  # noqa E501
+        """  # noqa: E501
 
         # __init__ is overridden to prevent __new__ from
         # calling the superclass constructor.
@@ -1834,7 +1834,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]):
                 parameter to :class:`_schema.Column`.
 
 
-        """  # noqa E501
+        """  # noqa: E501, RST201, RST202
 
         name = kwargs.pop("name", None)
         type_ = kwargs.pop("type_", None)
index 292225ce2e529f7c1f8796e7099f2eb1ec78652f..d7cc327333e0406f41e9f4009f3085e9b299d43c 100644 (file)
@@ -288,7 +288,7 @@ class Selectable(ReturnsRows):
         object, returning a copy of this :class:`_expression.FromClause`.
 
         """
-        return util.preloaded.sql_util.ClauseAdapter(alias).traverse(  # type: ignore  # noqa E501
+        return util.preloaded.sql_util.ClauseAdapter(alias).traverse(  # type: ignore  # noqa: E501
             self
         )
 
@@ -1040,7 +1040,7 @@ class SelectLabelStyle(Enum):
 
     .. versionadded:: 1.4
 
-    """  # noqa E501
+    """  # noqa: E501
 
     LABEL_STYLE_TABLENAME_PLUS_COL = 1
     """Label style indicating all columns should be labeled as
@@ -1691,7 +1691,7 @@ class TableValuedAlias(LateralFromClause, Alias):
 
         :ref:`tutorial_functions_table_valued` - in the :ref:`unified_tutorial`
 
-    """  # noqa E501
+    """  # noqa: E501
 
     __visit_name__ = "table_valued_alias"
 
@@ -1820,7 +1820,7 @@ class TableValuedAlias(LateralFromClause, Alias):
          datatype specification with each column. This is a special syntax
          currently known to be required by PostgreSQL for some SQL functions.
 
-        """  # noqa E501
+        """  # noqa: E501
 
         # note: don't use the @_generative system here, keep a reference
         # to the original object.  otherwise you can have re-use of the
@@ -5657,7 +5657,7 @@ class Select(
 
          .. versionadded:: 1.4.23
 
-        """  # noqa E501
+        """  # noqa: E501
 
         # memoizations should be cleared here as of
         # I95c560ffcbfa30b26644999412fb6a385125f663 , asserting this
index c3653c26472451517256cd9f4d495524b232674c..cbc4e9e707b202f4f7a92968c9a11fa4c4030354 100644 (file)
@@ -146,7 +146,7 @@ class HasShallowCopy(HasTraverseInternals):
                 "_generated_shallow_from_dict_traversal",
             )
 
-            cls._generated_shallow_from_dict_traversal = shallow_from_dict  # type: ignore  # noqa E501
+            cls._generated_shallow_from_dict_traversal = shallow_from_dict  # type: ignore  # noqa: E501
 
         shallow_from_dict(self, d)
 
@@ -164,7 +164,7 @@ class HasShallowCopy(HasTraverseInternals):
                 cls._traverse_internals, "_generated_shallow_to_dict_traversal"
             )
 
-            cls._generated_shallow_to_dict_traversal = shallow_to_dict  # type: ignore  # noqa E501
+            cls._generated_shallow_to_dict_traversal = shallow_to_dict  # type: ignore  # noqa: E501
         return shallow_to_dict(self)
 
     def _shallow_copy_to(
index 82adf4a4f94e8b63914a2a839bc0cde9a9982911..3293ecac03aa4e69dc26ee3d6b1d6059e1162de0 100644 (file)
@@ -176,7 +176,7 @@ class TypeEngine(Visitable, Generic[_T]):
             op_fn, addtl_kw = default_comparator.operator_lookup[op.__name__]
             if kwargs:
                 addtl_kw = addtl_kw.union(kwargs)
-            return op_fn(self.expr, op, other, reverse=True, **addtl_kw)  # type: ignore  # noqa E501
+            return op_fn(self.expr, op, other, reverse=True, **addtl_kw)  # type: ignore  # noqa: E501
 
         def _adapt_expression(
             self,
@@ -1656,14 +1656,14 @@ class TypeDecorator(SchemaEventTarget, ExternalType, TypeEngine[_T]):
     def comparator_factory(  # type: ignore  # mypy properties bug
         self,
     ) -> _ComparatorFactory[Any]:
-        if TypeDecorator.Comparator in self.impl.comparator_factory.__mro__:  # type: ignore # noqa E501
+        if TypeDecorator.Comparator in self.impl.comparator_factory.__mro__:  # type: ignore # noqa: E501
             return self.impl.comparator_factory
         else:
             # reconcile the Comparator class on the impl with that
             # of TypeDecorator
             return type(
                 "TDComparator",
-                (TypeDecorator.Comparator, self.impl.comparator_factory),  # type: ignore # noqa E501
+                (TypeDecorator.Comparator, self.impl.comparator_factory),  # type: ignore # noqa: E501
                 {},
             )
 
@@ -2173,7 +2173,7 @@ class TypeDecorator(SchemaEventTarget, ExternalType, TypeEngine[_T]):
 
     # mypy property bug
     @property
-    def sort_key_function(self) -> Optional[Callable[[Any], Any]]:  # type: ignore # noqa E501
+    def sort_key_function(self) -> Optional[Callable[[Any], Any]]:  # type: ignore # noqa: E501
         return self.impl_instance.sort_key_function
 
     def __repr__(self) -> str:
index 80711c4b57800f28a8f369125b07294670934e78..2790bf37358f2e085dd416365c92c8f08fc9b728 100644 (file)
@@ -40,11 +40,11 @@ from .base import _from_objects
 from .base import ColumnSet
 from .cache_key import HasCacheKey  # noqa
 from .ddl import sort_tables  # noqa
-from .elements import _find_columns  # noqa
+from .elements import _find_columns
 from .elements import _label_reference
 from .elements import _textual_label_reference
 from .elements import BindParameter
-from .elements import ClauseElement  # noqa
+from .elements import ClauseElement
 from .elements import ColumnClause
 from .elements import ColumnElement
 from .elements import Grouping
index 081faf1e9fb3b86d4e605d2df099db9fb3680573..5ff746bb3ac01822a2ebe8d916437abd7492bc44 100644 (file)
@@ -130,9 +130,9 @@ class Visitable:
             try:
                 meth = getter(visitor)
             except AttributeError as err:
-                return visitor.visit_unsupported_compilation(self, err, **kw)  # type: ignore  # noqa E501
+                return visitor.visit_unsupported_compilation(self, err, **kw)  # type: ignore  # noqa: E501
             else:
-                return meth(self, **kw)  # type: ignore  # noqa E501
+                return meth(self, **kw)  # type: ignore  # noqa: E501
 
         cls._compiler_dispatch = (  # type: ignore
             cls._original_compiler_dispatch
index a5c601995e03a9da03acd16a91ff20431a094c77..01c7b07686881a82c59af89c38f8427803849f54 100644 (file)
@@ -1420,7 +1420,7 @@ class SuiteRequirements(Requirements):
     def greenlet(self):
         def go(config):
             try:
-                import greenlet  # noqa F401
+                import greenlet  # noqa: F401
             except ImportError:
                 return False
             else:
index bcb2ad42306d967416a027fa8645074d607cba46..eb5b16b650c75bd53cdc7ff6ca0e566e646d3705 100644 (file)
@@ -388,11 +388,11 @@ class UniqueAppender(Generic[_T]):
         self.data = data
         self._unique = {}
         if via:
-            self._data_appender = getattr(data, via)  # type: ignore[assignment]  # noqa E501
+            self._data_appender = getattr(data, via)  # type: ignore[assignment]  # noqa: E501
         elif hasattr(data, "append"):
-            self._data_appender = cast("List[_T]", data).append  # type: ignore[assignment]  # noqa E501
+            self._data_appender = cast("List[_T]", data).append  # type: ignore[assignment]  # noqa: E501
         elif hasattr(data, "add"):
-            self._data_appender = cast("Set[_T]", data).add  # type: ignore[assignment]  # noqa E501
+            self._data_appender = cast("Set[_T]", data).add  # type: ignore[assignment]  # noqa: E501
 
     def append(self, item: _T) -> None:
         id_ = id(item)
index b17b408dd7bf972cd3296ce44847291583587f7e..28b062d3d9f99d2aa7674405182449075232140f 100644 (file)
@@ -122,7 +122,7 @@ def await_fallback(awaitable: Awaitable[_T]) -> _T:
                 "loop is already running; can't call await_() here. "
                 "Was IO attempted in an unexpected place?"
             )
-        return loop.run_until_complete(awaitable)  # type: ignore[no-any-return]  # noqa E501
+        return loop.run_until_complete(awaitable)  # type: ignore[no-any-return]  # noqa: E501
 
     return current.driver.switch(awaitable)  # type: ignore[no-any-return]
 
index 1016871aa7f4e795e30b5a1cc7cf59d913656f0f..d649a0bea712ed066ba3e450309899a773f76a6a 100644 (file)
@@ -195,7 +195,7 @@ class OrderedSet(Set[_T]):
         return self  # type: ignore
 
     def union(self, *other: Iterable[_S]) -> "OrderedSet[Union[_T, _S]]":
-        result: "OrderedSet[Union[_T, _S]]" = self.__class__(self)  # type: ignore  # noqa E501
+        result: "OrderedSet[Union[_T, _S]]" = self.__class__(self)  # type: ignore  # noqa: E501
         for o in other:
             result.update(o)
         return result
index 778d1275b93e2a96c2992bad2966e2ef37defe80..c1d53cc16f5918bdfcd17edfccfe02a8999fcf2f 100644 (file)
@@ -12,7 +12,7 @@ import typing
 have_greenlet = False
 greenlet_error = None
 try:
-    import greenlet  # type: ignore # noqa F401
+    import greenlet  # type: ignore # noqa: F401
 except ImportError as e:
     greenlet_error = str(e)
     pass
@@ -25,9 +25,9 @@ else:
     from ._concurrency_py3k import AsyncAdaptedLock as AsyncAdaptedLock
     from ._concurrency_py3k import (
         _util_async_run as _util_async_run,
-    )  # noqa F401
+    )  # noqa: F401
     from ._concurrency_py3k import (
-        _util_async_run_coroutine_function as _util_async_run_coroutine_function,  # noqa F401, E501
+        _util_async_run_coroutine_function as _util_async_run_coroutine_function,  # noqa: F401, E501
     )
 
 if not typing.TYPE_CHECKING and not have_greenlet:
@@ -45,23 +45,23 @@ if not typing.TYPE_CHECKING and not have_greenlet:
             else ""
         )
 
-    def is_exit_exception(e):  # noqa F811
+    def is_exit_exception(e):
         return not isinstance(e, Exception)
 
-    def await_only(thing):  # type: ignore # noqa F811
+    def await_only(thing):  # type: ignore
         _not_implemented()
 
-    def await_fallback(thing):  # type: ignore # noqa F81
+    def await_fallback(thing):  # type: ignore
         return thing
 
-    def greenlet_spawn(fn, *args, **kw):  # type: ignore # noqa F81
+    def greenlet_spawn(fn, *args, **kw):  # type: ignore
         _not_implemented()
 
-    def AsyncAdaptedLock(*args, **kw):  # type: ignore # noqa F81
+    def AsyncAdaptedLock(*args, **kw):  # type: ignore
         _not_implemented()
 
-    def _util_async_run(fn, *arg, **kw):  # type: ignore # noqa F81
+    def _util_async_run(fn, *arg, **kw):  # type: ignore
         return fn(*arg, **kw)
 
-    def _util_async_run_coroutine_function(fn, *arg, **kw):  # type: ignore # noqa F81
+    def _util_async_run_coroutine_function(fn, *arg, **kw):  # type: ignore
         _not_implemented()
index 00097fd9e7c946ecd50a5a798063a05d7fb9b3fe..8f0ec700f90786d5b70a7d9772971331e8311ed9 100644 (file)
@@ -510,7 +510,7 @@ def get_callable_argspec(
             fn.__init__, no_self=no_self, _is_init=True
         )
     elif hasattr(fn, "__func__"):
-        return compat.inspect_getfullargspec(fn.__func__)  # type: ignore[attr-defined] # noqa E501
+        return compat.inspect_getfullargspec(fn.__func__)  # type: ignore[attr-defined] # noqa: E501
     elif hasattr(fn, "__call__"):
         if inspect.ismethod(fn.__call__):  # type: ignore [operator]
             return get_callable_argspec(
@@ -711,7 +711,7 @@ def create_proxy_methods(
             else:
                 code = (
                     "def %(name)s%(grouped_args)s:\n"
-                    "    return %(self_arg)s._proxied.%(name)s(%(apply_kw_proxied)s)"  # noqa E501
+                    "    return %(self_arg)s._proxied.%(name)s(%(apply_kw_proxied)s)"  # noqa: E501
                     % metadata
                 )
 
@@ -1544,7 +1544,7 @@ def assert_arg_type(
         if isinstance(argtype, tuple):
             raise exc.ArgumentError(
                 "Argument '%s' is expected to be one of type %s, got '%s'"
-                % (name, " or ".join("'%s'" % a for a in argtype), type(arg))  # type: ignore  # noqa E501
+                % (name, " or ".join("'%s'" % a for a in argtype), type(arg))  # type: ignore  # noqa: E501
             )
         else:
             raise exc.ArgumentError(
index 0b9d8c62c765ef417a1e2c36b05305872859e416..df54017da78d3c0394b2ff9b75ba39b76e31aa05 100644 (file)
@@ -47,16 +47,16 @@ else:
 if typing.TYPE_CHECKING or compat.py310:
     from typing import Annotated as Annotated
 else:
-    from typing_extensions import Annotated as Annotated  # noqa F401
+    from typing_extensions import Annotated as Annotated  # noqa: F401
 
 if typing.TYPE_CHECKING or compat.py38:
     from typing import Literal as Literal
     from typing import Protocol as Protocol
     from typing import TypedDict as TypedDict
 else:
-    from typing_extensions import Literal as Literal  # noqa F401
-    from typing_extensions import Protocol as Protocol  # noqa F401
-    from typing_extensions import TypedDict as TypedDict  # noqa F401
+    from typing_extensions import Literal as Literal  # noqa: F401
+    from typing_extensions import Protocol as Protocol  # noqa: F401
+    from typing_extensions import TypedDict as TypedDict  # noqa: F401
 
 # copied from TypeShed, required in order to implement
 # MutableMapping.update()
@@ -77,8 +77,8 @@ if typing.TYPE_CHECKING or not compat.py310:
     from typing_extensions import Concatenate as Concatenate
     from typing_extensions import ParamSpec as ParamSpec
 else:
-    from typing import Concatenate as Concatenate  # noqa F401
-    from typing import ParamSpec as ParamSpec  # noqa F401
+    from typing import Concatenate as Concatenate  # noqa: F401
+    from typing import ParamSpec as ParamSpec  # noqa: F401
 
 
 def de_stringify_annotation(
index e03a8415d0c3f2e79effea7b0eed050e78a97c1c..23f03cc04f3d1138ec422fd6d9967f98d5d125cc 100644 (file)
@@ -1196,7 +1196,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1212,7 +1212,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1226,7 +1226,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1240,7 +1240,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1255,7 +1255,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1270,7 +1270,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1284,7 +1284,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1299,7 +1299,7 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
 
@@ -1313,6 +1313,6 @@ class AnnotatedOverheadTest(NoCache, fixtures.MappedTest):
             for i in range(100):
                 # test counts assume objects remain in the session
                 # from previous run
-                r = q.all()  # noqa F841
+                r = q.all()  # noqa: F841
 
         go()
index 08d727cb0dfd5f684ec5f08e966ed296d856806a..bf76dca43d9b9f5514389cc02809fa0d26bd8e8b 100644 (file)
@@ -820,7 +820,7 @@ class TypeReflectionTest(fixtures.TestBase):
                 oracle.FLOAT(16),
             ),  # using conversion
             (FLOAT(), DOUBLE_PRECISION()),
-            # from https://docs.oracle.com/cd/B14117_01/server.101/b10758/sqlqr06.htm  # noqa E501
+            # from https://docs.oracle.com/cd/B14117_01/server.101/b10758/sqlqr06.htm  # noqa: E501
             # DOUBLE PRECISION == precision 126
             # REAL == precision 63
             (oracle.FLOAT(126), DOUBLE_PRECISION()),
index 1a89041474b499262a9fd2e692be72ab15be9363..9ee9c76f46720cfcfb378ff3cba75e128ff3779a 100644 (file)
@@ -16,5 +16,5 @@ class User:
 
 u1 = User()
 
-# EXPECTED_MYPY: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")  # noqa E501
+# EXPECTED_MYPY: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")  # noqa: E501
 p: str = u1.name
index b1dabe8dc9b9a836e3eb20515571dedb61bc6082..e8ce35114e70d3542f18f4b97eb0c307564848f8 100644 (file)
@@ -19,5 +19,5 @@ class User:
 
 u1 = User()
 
-# EXPECTED_MYPY: Incompatible types in assignment (expression has type "Optional[str]", variable has type "Optional[int]") # noqa E501
+# EXPECTED_MYPY: Incompatible types in assignment (expression has type "Optional[str]", variable has type "Optional[int]") # noqa: E501
 p: Optional[int] = u1.name
index 2154ff074c6344c4431e122ffc36acc5b44bdd95..d72649b62a4c625f5f9783706441c3c08804fb9b 100644 (file)
@@ -22,5 +22,5 @@ class User:
 
 u1 = User()
 
-# EXPECTED_MYPY: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")  # noqa E501
+# EXPECTED_MYPY: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")  # noqa: E501
 p: str = u1.name
index 5084de7225e1154e782db3671fb037d7214f6ec6..e9ff303ca781618cecbf80cd22c5109dac658f45 100644 (file)
@@ -11,5 +11,5 @@ class User:
     __tablename__ = "user"
 
     id = Column(Integer(), primary_key=True)
-    # EXPECTED: Left hand assignment 'name: "int"' not compatible with ORM mapped expression # noqa E501
+    # EXPECTED: Left hand assignment 'name: "int"' not compatible with ORM mapped expression # noqa: E501
     name: int = Column(String())
index beb4a7a5d0cd51eae557f95f667d79918f3258af..0b933db4785ad8e75c80c4457e07912c76cefb11 100644 (file)
@@ -20,6 +20,6 @@ class Address:
     __tablename__ = "address"
 
     id = Column(Integer, primary_key=True)
-    # EXPECTED: Can't infer type from ORM mapped expression assigned to attribute 'user_id';  # noqa E501
+    # EXPECTED: Can't infer type from ORM mapped expression assigned to attribute 'user_id';  # noqa: E501
     user_id = Column(ForeignKey("user.id"))
     email_address = Column(String)
index daa8a857793a89d798c3bdf768864f078962a887..3a932021de25e2d2966d06d4c0b1f2b94975a4be 100644 (file)
@@ -231,7 +231,7 @@ class MypyPluginTest(fixtures.TestBase):
                     is_re = bool(m.group(2))
                     is_type = bool(m.group(3))
 
-                    expected_msg = re.sub(r"# noqa ?.*", "", m.group(4))
+                    expected_msg = re.sub(r"# noqa[:]? ?.*", "", m.group(4))
                     if is_type:
                         is_mypy = is_re = True
                         expected_msg = f'Revealed type is "{expected_msg}"'
@@ -281,7 +281,7 @@ class MypyPluginTest(fixtures.TestBase):
                 for idx, (typ, errmsg) in enumerate(output):
                     if is_re:
                         if re.match(
-                            rf".*{filename}\:{num}\: {typ}\: {prefix}{msg}",  # noqa E501
+                            rf".*{filename}\:{num}\: {typ}\: {prefix}{msg}",  # noqa: E501
                             errmsg,
                         ):
                             break
index 57ce969ac885dcf9b9920eac271596cc537403c3..9ddd2f40e25fd7e0bcb3aa112f302bff0bcbe0cc 100644 (file)
@@ -621,7 +621,7 @@ class RelationshipLHSTest(fixtures.TestBase, testing.AssertsCompiledSQL):
             __sa_dataclass_metadata_key__ = "sa"
 
             id: Mapped[int] = mapped_column(primary_key=True)
-            bs: List["B"] = dataclasses.field(  # noqa: F821
+            bs: List["B"] = dataclasses.field(
                 default_factory=list, metadata={"sa": relationship()}
             )
 
@@ -642,9 +642,7 @@ class RelationshipLHSTest(fixtures.TestBase, testing.AssertsCompiledSQL):
 
             id: Mapped[int] = mapped_column(primary_key=True)
             data: Mapped[str] = mapped_column()
-            bs: Mapped[List["B"]] = relationship(  # noqa F821
-                back_populates="a"
-            )
+            bs: Mapped[List["B"]] = relationship(back_populates="a")
 
         class B(decl_base):
             __tablename__ = "b"
@@ -719,16 +717,10 @@ class RelationshipLHSTest(fixtures.TestBase, testing.AssertsCompiledSQL):
 
             id: Mapped[int] = mapped_column(primary_key=True)
             data: Mapped[str] = mapped_column()
-            bs_list: Mapped[List["B"]] = relationship(  # noqa F821
-                viewonly=True
-            )
-            bs_set: Mapped[Set["B"]] = relationship(viewonly=True)  # noqa F821
-            bs_list_warg: Mapped[List["B"]] = relationship(  # noqa F821
-                "B", viewonly=True
-            )
-            bs_set_warg: Mapped[Set["B"]] = relationship(  # noqa F821
-                "B", viewonly=True
-            )
+            bs_list: Mapped[List["B"]] = relationship(viewonly=True)
+            bs_set: Mapped[Set["B"]] = relationship(viewonly=True)
+            bs_list_warg: Mapped[List["B"]] = relationship("B", viewonly=True)
+            bs_set_warg: Mapped[Set["B"]] = relationship("B", viewonly=True)
 
         class B(decl_base):
             __tablename__ = "b"
@@ -756,7 +748,7 @@ class RelationshipLHSTest(fixtures.TestBase, testing.AssertsCompiledSQL):
 
             id: Mapped[int] = mapped_column(primary_key=True)
             data: Mapped[str] = mapped_column()
-            bs: Mapped[Dict[str, "B"]] = relationship()  # noqa F821
+            bs: Mapped[Dict[str, "B"]] = relationship()
 
         class B(decl_base):
             __tablename__ = "b"
@@ -779,7 +771,7 @@ class RelationshipLHSTest(fixtures.TestBase, testing.AssertsCompiledSQL):
             id: Mapped[int] = mapped_column(primary_key=True)
             data: Mapped[str] = mapped_column()
 
-            bs: Mapped[MappedCollection[str, "B"]] = relationship(  # noqa F821
+            bs: Mapped[MappedCollection[str, "B"]] = relationship(
                 collection_class=attribute_mapped_collection("name")
             )
 
@@ -1048,7 +1040,7 @@ class AllYourFavoriteHitsTest(fixtures.TestBase, testing.AssertsCompiledSQL):
 
             name: Mapped[str50]
 
-            employees: Mapped[Set["Person"]] = relationship()  # noqa F821
+            employees: Mapped[Set["Person"]] = relationship()
 
         class Person(decl_base):
             __tablename__ = "person"
index 97ee97bc08576c4a406d1ff7bdba48d1aa0f3cd2..587c498eae91f4801ccc8d0bfb5f5aa4609e8262 100644 (file)
@@ -1345,7 +1345,7 @@ class NonPrimaryMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
         with testing.expect_deprecated(
             "The mapper.non_primary parameter is deprecated"
         ):
-            m = self.mapper_registry.map_imperatively(  # noqa F841
+            m = self.mapper_registry.map_imperatively(  # noqa: F841
                 User,
                 users,
                 non_primary=True,
@@ -1402,7 +1402,7 @@ class NonPrimaryMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
         with testing.expect_deprecated(
             "The mapper.non_primary parameter is deprecated"
         ):
-            m = registry.map_imperatively(  # noqa F841
+            m = registry.map_imperatively(  # noqa: F841
                 User,
                 users,
                 non_primary=True,
index c055bc15078c8d669b830e143ab6ea798cb238ee..693a41c3acc06723014d67d18120c699bb72c4dc 100644 (file)
@@ -1394,7 +1394,7 @@ class TableValuedCompileTest(fixtures.TestBase, AssertsCompiledSQL):
         `WITH ORDINALITY AS unnested(unnested, ordinality) ON true
         LEFT OUTER JOIN b ON unnested.unnested = b.ref
 
-        """  # noqa 501
+        """  # noqa: 501
 
         a = table("a", column("id"), column("refs"))
         b = table("b", column("id"), column("ref"))