Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make these ignores more specific
  • Loading branch information
PeterJCLaw committed Sep 24, 2022
commit 17aa9c1a1857bb7b7ac71c0042bdf185d169f35d
9 changes: 5 additions & 4 deletions routemaster/state_machine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_current_history(app: App, label: LabelRef) -> History:
# sqlalchemy actually allows the attribute to be used for ordering like
# this; ignore the type check here specifically rather than complicate
# our type definitions.
History.id.desc(), # type: ignore
History.id.desc(), # type: ignore[attr-defined]
).first()

if history_entry is None:
Expand Down Expand Up @@ -154,13 +154,14 @@ def labels_in_state_with_metadata(

metadata_lookup = Label.metadata
for part in path:
metadata_lookup = metadata_lookup[part] # type: ignore
metadata_lookup = metadata_lookup[part] # type: ignore[call-overload, index] # noqa: E501

return _labels_in_state(
app,
state_machine,
state,
metadata_lookup.astext.in_(values), # type: ignore
# TODO: use the sqlalchemy mypy plugin rather than our stubs file
metadata_lookup.astext.in_(values), # type: ignore[union-attr]
)


Expand Down Expand Up @@ -200,7 +201,7 @@ def _labels_in_state(
# sqlalchemy actually allows the attribute to be used for ordering
# like this; ignore the type check here specifically rather than
# complicate our type definitions.
order_by=History.id.desc(), # type: ignore
order_by=History.id.desc(), # type: ignore[attr-defined]
partition_by=History.label_name,
).label('rank'),
).filter_by(
Expand Down