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

Use list comprehensions to bind TaskGroup type #4401

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def active(self):
return [
tg
for tg in self._groups
if any(v != 0 for k, v in tg._states.items() if k != "forgotten")
if any([v != 0 for k, v in tg._states.items() if k != "forgotten"])
]

@property
Expand Down Expand Up @@ -5570,7 +5570,7 @@ def transition(self, key, finish, *args, **kwargs):
if ts._state == "forgotten" and ts._group._name in self.task_groups:
# Remove TaskGroup if all tasks are in the forgotten state
tg: TaskGroup = ts._group
if not any(tg._states.get(s) for s in ALL_TASK_STATES):
if not any([tg._states.get(s) for s in ALL_TASK_STATES]):
ts._prefix._groups.remove(tg)
del self.task_groups[tg._name]

Expand Down