Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint #6161

Merged
merged 4 commits into from
Jul 18, 2024
Merged

Lint #6161

Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion cylc/flow/network/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _report(
"""
try:
ret: List[Tuple[Optional[str], Optional[str], bool]] = []
for _mutation_name, mutation_response in response.items():
for mutation_response in response.values():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PERF101: don't needless iterate items

# extract the result of each mutation result in the response
success, msg = mutation_response['result'][0]['response']
out = None
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ def process_queued_task_messages(self) -> None:
# Remaining unprocessed messages have no corresponding task proxy.
# For example, if I manually set a running task to succeeded, the
# proxy can be removed, but the orphaned job still sends messages.
for _id, tms in messages.items():
for tms in messages.values():
warn = "Undeliverable task messages received and ignored:"
for _, msg in tms:
warn += f'\n {msg.job_id}: {msg.severity} - "{msg.message}"'
Expand Down
4 changes: 2 additions & 2 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,8 @@ def get_tasks(self) -> List[TaskProxy]:
if self.active_tasks_changed:
self.active_tasks_changed = False
self._active_tasks_list = []
for _, itask_id_map in self.active_tasks.items():
for __, itask in itask_id_map.items():
for itask_id_map in self.active_tasks.values():
for itask in itask_id_map.values():
self._active_tasks_list.append(itask)
return self._active_tasks_list

Expand Down