Skip to content

Commit 11bf824

Browse files
committed
update flake8 noqa skips with proper syntax
Change-Id: I42ed77f559e3ee5b8c600d98457ee37803ef0ea6
1 parent fd05273 commit 11bf824

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+122
-130
lines changed

lib/sqlalchemy/connectors/pyodbc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _get_server_version_info(
180180
dbapi_con = connection.connection.dbapi_connection
181181
version: Tuple[Union[int, str], ...] = ()
182182
r = re.compile(r"[.\-]")
183-
for n in r.split(dbapi_con.getinfo(self.dbapi.SQL_DBMS_VER)): # type: ignore[union-attr] # noqa E501
183+
for n in r.split(dbapi_con.getinfo(self.dbapi.SQL_DBMS_VER)): # type: ignore[union-attr] # noqa: E501
184184
try:
185185
version += (int(n),)
186186
except ValueError:
@@ -215,7 +215,7 @@ def do_set_input_sizes(
215215
def get_isolation_level_values(
216216
self, dbapi_connection: interfaces.DBAPIConnection
217217
) -> List[_IsolationLevel]:
218-
return super().get_isolation_level_values(dbapi_connection) + [ # type: ignore # noqa E501
218+
return super().get_isolation_level_values(dbapi_connection) + [ # type: ignore # noqa: E501
219219
"AUTOCOMMIT"
220220
]
221221

lib/sqlalchemy/dialects/oracle/provision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def stop_test_class_outside_fixtures(config, db, cls):
6363
try:
6464
with db.begin() as conn:
6565
# run magic command to get rid of identity sequences
66-
# https://floo.bar/2019/11/29/drop-the-underlying-sequence-of-an-identity-column/ # noqa E501
66+
# https://floo.bar/2019/11/29/drop-the-underlying-sequence-of-an-identity-column/ # noqa: E501
6767
conn.exec_driver_sql("purge recyclebin")
6868
except exc.DatabaseError as err:
6969
log.warning("purge recyclebin command failed: %s", err)

lib/sqlalchemy/dialects/postgresql/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ def bind_expression(self, bindvalue):
14211421
)
14221422
14231423
1424-
""" # noqa E501
1424+
""" # noqa: E501
14251425

14261426
from collections import defaultdict
14271427
import datetime as dt

lib/sqlalchemy/engine/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2655,7 +2655,7 @@ def _switch_shard(conn, cursor, stmt,
26552655
:meth:`_engine.Engine.get_execution_options`
26562656
26572657
2658-
""" # noqa E501
2658+
""" # noqa: E501
26592659
return self._option_cls(self, opt)
26602660

26612661
def get_execution_options(self) -> _ExecuteOptions:

lib/sqlalchemy/engine/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ def rowcount(self):
16371637
16381638
:ref:`tutorial_update_delete_rowcount` - in the :ref:`unified_tutorial`
16391639
1640-
""" # noqa E501
1640+
""" # noqa: E501
16411641

16421642
try:
16431643
return self.context.rowcount

lib/sqlalchemy/engine/result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def _allrows(self) -> List[_RowData]:
502502
)
503503
for made_row in made_rows
504504
]
505-
if sig_row not in uniques and not uniques.add(sig_row) # type: ignore # noqa E501
505+
if sig_row not in uniques and not uniques.add(sig_row) # type: ignore # noqa: E501
506506
]
507507
else:
508508
interim_rows = made_rows
@@ -749,7 +749,7 @@ def _column_slices(
749749
real_result = self._real_result if self._real_result else self
750750

751751
if (
752-
real_result._source_supports_scalars # type: ignore[attr-defined] # noqa E501
752+
real_result._source_supports_scalars # type: ignore[attr-defined] # noqa: E501
753753
and len(indexes) == 1
754754
):
755755
self._generate_rows = False

lib/sqlalchemy/event/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def _create_dispatcher_class(
319319
assert dispatch_target_cls is not None
320320
if (
321321
hasattr(dispatch_target_cls, "__slots__")
322-
and "_slots_dispatch" in dispatch_target_cls.__slots__ # type: ignore # noqa E501
322+
and "_slots_dispatch" in dispatch_target_cls.__slots__ # type: ignore # noqa: E501
323323
):
324324
dispatch_target_cls.dispatch = slots_dispatcher(cls)
325325
else:

lib/sqlalchemy/event/legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _legacy_signature(
5151
def leg(fn: Callable[..., Any]) -> Callable[..., Any]:
5252
if not hasattr(fn, "_legacy_signatures"):
5353
fn._legacy_signatures = [] # type: ignore[attr-defined]
54-
fn._legacy_signatures.append((since, argnames, converter)) # type: ignore[attr-defined] # noqa E501
54+
fn._legacy_signatures.append((since, argnames, converter)) # type: ignore[attr-defined] # noqa: E501
5555
return fn
5656

5757
return leg

lib/sqlalchemy/ext/associationproxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ def contains(self, other: Any, **kw: Any) -> ColumnElement[bool]:
11761176
**{self.value_attr: other}
11771177
)
11781178

1179-
def __eq__(self, obj: Any) -> ColumnElement[bool]: # type: ignore[override] # noqa E501
1179+
def __eq__(self, obj: Any) -> ColumnElement[bool]: # type: ignore[override] # noqa: E501
11801180
# note the has() here will fail for collections; eq_()
11811181
# is only allowed with a scalar.
11821182
if obj is None:
@@ -1187,7 +1187,7 @@ def __eq__(self, obj: Any) -> ColumnElement[bool]: # type: ignore[override] #
11871187
else:
11881188
return self._comparator.has(**{self.value_attr: obj})
11891189

1190-
def __ne__(self, obj: Any) -> ColumnElement[bool]: # type: ignore[override] # noqa E501
1190+
def __ne__(self, obj: Any) -> ColumnElement[bool]: # type: ignore[override] # noqa: E501
11911191
# note the has() here will fail for collections; eq_()
11921192
# is only allowed with a scalar.
11931193
return self._comparator.has(
@@ -1203,7 +1203,7 @@ class ColumnAssociationProxyInstance(AssociationProxyInstance[_T]):
12031203
_target_is_object: bool = False
12041204
_is_canonical = True
12051205

1206-
def __eq__(self, other: Any) -> ColumnElement[bool]: # type: ignore[override] # noqa E501
1206+
def __eq__(self, other: Any) -> ColumnElement[bool]: # type: ignore[override] # noqa: E501
12071207
# special case "is None" to check for no related row as well
12081208
expr = self._criterion_exists(
12091209
self.remote_attr.operate(operators.eq, other)

lib/sqlalchemy/ext/asyncio/scoping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(self, session_factory, scopefunc):
8585
the current scope. A function such as ``asyncio.current_task``
8686
may be useful here.
8787
88-
""" # noqa E501
88+
""" # noqa: E501
8989

9090
self.session_factory = session_factory
9191
self.registry = ScopedRegistry(session_factory, scopefunc)

0 commit comments

Comments
 (0)