From 7097abc3918c4e2234ae07ab14b91bef4fc46644 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Mon, 11 Apr 2022 22:21:20 +0200 Subject: [PATCH] update flake8 noqa skips with proper syntax Change-Id: I42ed77f559e3ee5b8c600d98457ee37803ef0ea6 (cherry picked from commit 139c6ec0fb1f930be9b64545262d2580f6cbc83e) --- lib/sqlalchemy/dialects/oracle/provision.py | 2 +- lib/sqlalchemy/dialects/postgresql/base.py | 2 +- lib/sqlalchemy/engine/cursor.py | 2 +- lib/sqlalchemy/ext/asyncio/scoping.py | 2 +- lib/sqlalchemy/ext/asyncio/session.py | 2 +- lib/sqlalchemy/orm/decl_api.py | 2 +- lib/sqlalchemy/orm/loading.py | 2 +- lib/sqlalchemy/sql/dml.py | 4 +-- lib/sqlalchemy/sql/functions.py | 14 +++++----- lib/sqlalchemy/sql/schema.py | 2 +- lib/sqlalchemy/sql/selectable.py | 12 ++++----- lib/sqlalchemy/testing/requirements.py | 2 +- lib/sqlalchemy/util/concurrency.py | 26 +++++++++---------- lib/sqlalchemy/util/langhelpers.py | 8 +++--- test/aaa_profiling/test_orm.py | 18 ++++++------- test/engine/test_execute.py | 8 +++--- .../ensure_descriptor_type_fully_inferred.py | 2 +- .../ensure_descriptor_type_noninferred.py | 2 +- .../ensure_descriptor_type_semiinferred.py | 2 +- .../mypy/files/invalid_noninferred_lh_type.py | 2 +- .../mypy/files/typeless_fk_col_cant_infer.py | 2 +- test/ext/mypy/test_mypy_plugin_py3k.py | 2 +- test/orm/test_deprecations.py | 6 ++--- test/sql/test_functions.py | 2 +- 24 files changed, 64 insertions(+), 64 deletions(-) diff --git a/lib/sqlalchemy/dialects/oracle/provision.py b/lib/sqlalchemy/dialects/oracle/provision.py index 8ce58782be..74ad1f2a4b 100644 --- a/lib/sqlalchemy/dialects/oracle/provision.py +++ b/lib/sqlalchemy/dialects/oracle/provision.py @@ -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) diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 4f63002bc9..bbc64cf710 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1421,7 +1421,7 @@ E.g.:: ) -""" # noqa E501 +""" # noqa: E501 from collections import defaultdict import datetime as dt diff --git a/lib/sqlalchemy/engine/cursor.py b/lib/sqlalchemy/engine/cursor.py index abe42c96ad..e17422e1c3 100644 --- a/lib/sqlalchemy/engine/cursor.py +++ b/lib/sqlalchemy/engine/cursor.py @@ -1683,7 +1683,7 @@ class BaseCursorResult(object): :ref:`tutorial_update_delete_rowcount` - in the :ref:`unified_tutorial` - """ # noqa E501 + """ # noqa: E501 try: return self.context.rowcount diff --git a/lib/sqlalchemy/ext/asyncio/scoping.py b/lib/sqlalchemy/ext/asyncio/scoping.py index 46c8f0baa7..8eca8c5248 100644 --- a/lib/sqlalchemy/ext/asyncio/scoping.py +++ b/lib/sqlalchemy/ext/asyncio/scoping.py @@ -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) diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py index 0b428d7fed..53ebbc0097 100644 --- a/lib/sqlalchemy/ext/asyncio/session.py +++ b/lib/sqlalchemy/ext/asyncio/session.py @@ -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 diff --git a/lib/sqlalchemy/orm/decl_api.py b/lib/sqlalchemy/orm/decl_api.py index 42419e48cd..4b6c710c72 100644 --- a/lib/sqlalchemy/orm/decl_api.py +++ b/lib/sqlalchemy/orm/decl_api.py @@ -200,7 +200,7 @@ class declared_attr(interfaces._MappedAttribute, property): :ref:`orm_declarative_dataclasses_mixin` - illustrates special forms for use with Python dataclasses - """ # noqa E501 + """ # noqa: E501 def __init__(self, fget, cascading=False): super(declared_attr, self).__init__(fget) diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py index 7dee717c68..b5691c0c97 100644 --- a/lib/sqlalchemy/orm/loading.py +++ b/lib/sqlalchemy/orm/loading.py @@ -758,7 +758,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] diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 943bb07054..4f3280373b 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -439,7 +439,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" @@ -578,7 +578,7 @@ class UpdateBase( :ref:`queryguide_inspection` - ORM background - """ # noqa E501 + """ # noqa: E501 meth = DMLState.get_plugin_class( self ).get_returning_column_descriptions diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index e0ff1655f9..584782b281 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -167,7 +167,7 @@ class FunctionElement(Executable, ColumnElement, FromClause, Generative): :meth:`_functions.FunctionElement.column_valued` - """ # noqa E501 + """ # noqa: E501 return ScalarFunctionColumn(self, name, type_) @@ -237,7 +237,7 @@ class FunctionElement(Executable, ColumnElement, 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() @@ -280,7 +280,7 @@ class FunctionElement(Executable, ColumnElement, FromClause, Generative): :meth:`_functions.FunctionElement.table_valued` - """ # noqa 501 + """ # noqa: 501 return self.alias(name=name).column @@ -305,7 +305,7 @@ class FunctionElement(Executable, ColumnElement, FromClause, Generative): :meth:`_functions.FunctionElement.table_valued` - generates table-valued SQL function expressions. - """ # noqa E501 + """ # noqa: E501 return ColumnCollection( columns=[(col.key, col) for col in self._all_selected_columns] @@ -1170,19 +1170,19 @@ class coalesce(ReturnTypeFromArgs): inherit_cache = True -class max(ReturnTypeFromArgs): # noqa A001 +class max(ReturnTypeFromArgs): # noqa: A001 """The SQL MAX() aggregate function.""" inherit_cache = True -class min(ReturnTypeFromArgs): # noqa A001 +class min(ReturnTypeFromArgs): # noqa: A001 """The SQL MIN() aggregate function.""" inherit_cache = True -class sum(ReturnTypeFromArgs): # noqa A001 +class sum(ReturnTypeFromArgs): # noqa: A001 """The SQL SUM() aggregate function.""" inherit_cache = True diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 621efd36ce..d91e4e1661 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -1661,7 +1661,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause): parameter to :class:`_schema.Column`. - """ # noqa E501 + """ # noqa: E501, RST201, RST202 name = kwargs.pop("name", None) type_ = kwargs.pop("type_", None) diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index ea81ce6705..740085043c 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -889,7 +889,7 @@ LABEL_STYLE_NONE = util.symbol( .. versionadded:: 1.4 -""", # noqa E501 +""", # noqa: E501 ) LABEL_STYLE_TABLENAME_PLUS_COL = util.symbol( @@ -919,7 +919,7 @@ LABEL_STYLE_TABLENAME_PLUS_COL = util.symbol( .. versionadded:: 1.4 -""", # noqa E501 +""", # noqa: E501 ) @@ -1757,7 +1757,7 @@ class TableValuedAlias(Alias): :ref:`tutorial_functions_table_valued` - in the :ref:`unified_tutorial` - """ # noqa E501 + """ # noqa: E501 __visit_name__ = "table_valued_alias" @@ -1884,7 +1884,7 @@ class TableValuedAlias(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 @@ -5897,7 +5897,7 @@ class Select( .. versionadded:: 1.4.23 - """ # noqa E501 + """ # noqa: E501 # memoizations should be cleared here as of # I95c560ffcbfa30b26644999412fb6a385125f663 , asserting this @@ -6709,7 +6709,7 @@ class Exists(UnaryExpression): :meth:`_sql.SelectBase.exists` - method to transform a ``SELECT`` to an ``EXISTS`` clause. - """ # noqa E501 + """ # noqa: E501 if args and isinstance(args[0], (SelectBase, ScalarSelect)): s = args[0] else: diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index ce1b5d3c1c..49e3cefb41 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -1386,7 +1386,7 @@ class SuiteRequirements(Requirements): def greenlet(self): def go(config): try: - import greenlet # noqa F401 + import greenlet # noqa: F401 except ImportError: return False else: diff --git a/lib/sqlalchemy/util/concurrency.py b/lib/sqlalchemy/util/concurrency.py index 9eb44f4657..e900b437e7 100644 --- a/lib/sqlalchemy/util/concurrency.py +++ b/lib/sqlalchemy/util/concurrency.py @@ -12,7 +12,7 @@ greenlet_error = None if compat.py3k: try: - import greenlet # noqa F401 + import greenlet # noqa: F401 except ImportError as e: greenlet_error = str(e) else: @@ -22,18 +22,18 @@ if compat.py3k: from ._concurrency_py3k import greenlet_spawn from ._concurrency_py3k import is_exit_exception from ._concurrency_py3k import AsyncAdaptedLock - from ._concurrency_py3k import _util_async_run # noqa F401 + from ._concurrency_py3k import _util_async_run # noqa: F401 from ._concurrency_py3k import ( _util_async_run_coroutine_function, - ) # noqa F401, E501 - from ._concurrency_py3k import asyncio # noqa F401 + ) # noqa: F401, E501 + from ._concurrency_py3k import asyncio # noqa: F401 # does not need greennlet, just Python 3 - from ._compat_py3k import asynccontextmanager # noqa F401 + from ._compat_py3k import asynccontextmanager # noqa: F401 if not have_greenlet: - asyncio = None # noqa F811 + asyncio = None # noqa: F811 def _not_implemented(): # this conditional is to prevent pylance from considering @@ -51,23 +51,23 @@ if not have_greenlet: else "" ) - def is_exit_exception(e): # noqa F811 + def is_exit_exception(e): # noqa: F811 return not isinstance(e, Exception) - def await_only(thing): # noqa F811 + def await_only(thing): # noqa: F811 _not_implemented() - def await_fallback(thing): # noqa F81 + def await_fallback(thing): # noqa: F811 return thing - def greenlet_spawn(fn, *args, **kw): # noqa F81 + def greenlet_spawn(fn, *args, **kw): # noqa: F811 _not_implemented() - def AsyncAdaptedLock(*args, **kw): # noqa F81 + def AsyncAdaptedLock(*args, **kw): # noqa: F811 _not_implemented() - def _util_async_run(fn, *arg, **kw): # noqa F81 + def _util_async_run(fn, *arg, **kw): # noqa: F811 return fn(*arg, **kw) - def _util_async_run_coroutine_function(fn, *arg, **kw): # noqa F81 + def _util_async_run_coroutine_function(fn, *arg, **kw): # noqa: F811 _not_implemented() diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 68074dc335..8d5de18314 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -668,7 +668,7 @@ def create_proxy_methods( else: code = ( "def %(name)s(%(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 ) @@ -1932,9 +1932,9 @@ def repr_tuple_names(names): def has_compiled_ext(): try: - from sqlalchemy import cimmutabledict # noqa F401 - from sqlalchemy import cprocessors # noqa F401 - from sqlalchemy import cresultproxy # noqa F401 + from sqlalchemy import cimmutabledict # noqa: F401 + from sqlalchemy import cprocessors # noqa: F401 + from sqlalchemy import cresultproxy # noqa: F401 return True except ImportError: diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index 65b1547a18..bbcb6ad5b8 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -1227,7 +1227,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() @@ -1243,7 +1243,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() @@ -1257,7 +1257,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() @@ -1271,7 +1271,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() @@ -1286,7 +1286,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() @@ -1301,7 +1301,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() @@ -1315,7 +1315,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() @@ -1330,7 +1330,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() @@ -1344,6 +1344,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() diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index 2a61bd1f63..afb7ddd4d4 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -471,7 +471,7 @@ class ExecuteTest(fixtures.TablesTest): eq_(str(err), message) # unicode accessor decodes to utf-8 - eq_(unicode(err), util.u("some message méil")) # noqa F821 + eq_(unicode(err), util.u("some message méil")) # noqa: F821 else: eq_(str(err), util.u("some message méil")) @@ -486,7 +486,7 @@ class ExecuteTest(fixtures.TablesTest): eq_(str(err), message) # unicode accessor decodes to utf-8 - eq_(unicode(err), util.u("some message m\\xe9il")) # noqa F821 + eq_(unicode(err), util.u("some message m\\xe9il")) # noqa: F821 else: eq_(str(err), util.u("some message m\\xe9il")) @@ -497,7 +497,7 @@ class ExecuteTest(fixtures.TablesTest): err = tsa.exc.SQLAlchemyError(message) if util.py2k: - eq_(unicode(err), util.u("some message méil")) # noqa F821 + eq_(unicode(err), util.u("some message méil")) # noqa: F821 else: eq_(str(err), util.u("some message méil")) @@ -506,7 +506,7 @@ class ExecuteTest(fixtures.TablesTest): eq_(str(err), "foo") if util.py2k: - eq_(unicode(err), util.u("fóó")) # noqa F821 + eq_(unicode(err), util.u("fóó")) # noqa: F821 def test_stmt_exception_str_multi_args(self): err = tsa.exc.SQLAlchemyError("some message", 206) diff --git a/test/ext/mypy/files/ensure_descriptor_type_fully_inferred.py b/test/ext/mypy/files/ensure_descriptor_type_fully_inferred.py index 1a89041474..9ee9c76f46 100644 --- a/test/ext/mypy/files/ensure_descriptor_type_fully_inferred.py +++ b/test/ext/mypy/files/ensure_descriptor_type_fully_inferred.py @@ -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 diff --git a/test/ext/mypy/files/ensure_descriptor_type_noninferred.py b/test/ext/mypy/files/ensure_descriptor_type_noninferred.py index b1dabe8dc9..e8ce35114e 100644 --- a/test/ext/mypy/files/ensure_descriptor_type_noninferred.py +++ b/test/ext/mypy/files/ensure_descriptor_type_noninferred.py @@ -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 diff --git a/test/ext/mypy/files/ensure_descriptor_type_semiinferred.py b/test/ext/mypy/files/ensure_descriptor_type_semiinferred.py index 2154ff074c..d72649b62a 100644 --- a/test/ext/mypy/files/ensure_descriptor_type_semiinferred.py +++ b/test/ext/mypy/files/ensure_descriptor_type_semiinferred.py @@ -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 diff --git a/test/ext/mypy/files/invalid_noninferred_lh_type.py b/test/ext/mypy/files/invalid_noninferred_lh_type.py index 5084de7225..e9ff303ca7 100644 --- a/test/ext/mypy/files/invalid_noninferred_lh_type.py +++ b/test/ext/mypy/files/invalid_noninferred_lh_type.py @@ -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()) diff --git a/test/ext/mypy/files/typeless_fk_col_cant_infer.py b/test/ext/mypy/files/typeless_fk_col_cant_infer.py index beb4a7a5d0..0b933db478 100644 --- a/test/ext/mypy/files/typeless_fk_col_cant_infer.py +++ b/test/ext/mypy/files/typeless_fk_col_cant_infer.py @@ -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) diff --git a/test/ext/mypy/test_mypy_plugin_py3k.py b/test/ext/mypy/test_mypy_plugin_py3k.py index 681c9d57ba..5a6a297273 100644 --- a/test/ext/mypy/test_mypy_plugin_py3k.py +++ b/test/ext/mypy/test_mypy_plugin_py3k.py @@ -174,7 +174,7 @@ class MypyPluginTest(fixtures.TestBase): if m: is_mypy = bool(m.group(1)) expected_msg = m.group(2) - expected_msg = re.sub(r"# noqa ?.*", "", m.group(2)) + expected_msg = re.sub(r"# noqa[:]? ?.*", "", m.group(2)) expected_errors.append( (num, is_mypy, expected_msg.strip()) ) diff --git a/test/orm/test_deprecations.py b/test/orm/test_deprecations.py index 253dfa17b1..33a91184c2 100644 --- a/test/orm/test_deprecations.py +++ b/test/orm/test_deprecations.py @@ -3151,7 +3151,7 @@ class DeprecatedInhTest(_poly_fixtures._Polymorphic): mach_alias = machines.select() # note python 2 does not allow parens here; reformat in py3 only - with DeprecatedQueryTest._expect_implicit_subquery(), _aliased_join_warning( # noqa E501 + with DeprecatedQueryTest._expect_implicit_subquery(), _aliased_join_warning( # noqa: E501 "Person->people" ): self.assert_compile( @@ -3884,7 +3884,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, @@ -3947,7 +3947,7 @@ class NonPrimaryMapperTest(_fixtures.FixtureTest, AssertsCompiledSQL): with testing.expect_deprecated( "The mapper.non_primary parameter is deprecated" ): - m = mapper( # noqa F841 + m = mapper( # noqa: F841 User, users, non_primary=True, diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index c4326b8abc..3a9a06728c 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -1399,7 +1399,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")) -- 2.47.2