Skip to content

Commit e0d0809

Browse files
committed
Fixes some incorrect annotations
1 parent 56217db commit e0d0809

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: trailing-whitespace
66
exclude: '^(.bumpversion.cfg)$'
@@ -19,14 +19,14 @@ repos:
1919
- id: nocheckin
2020
exclude: .pre-commit-config.yaml
2121
- repo: https://github.com/PyCQA/flake8
22-
rev: 6.0.0
22+
rev: 7.0.0
2323
hooks:
2424
- id: flake8
2525
additional_dependencies:
2626
- flake8-bugbear
2727
files: '^(src/.*|tests/.*)\.py$'
2828
- repo: https://github.com/PyCQA/bandit
29-
rev: 1.7.5
29+
rev: 1.7.6
3030
hooks:
3131
- id: bandit
3232
args: ["-c", "pyproject.toml", "--quiet"]

HISTORY.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
---------
33

4+
- Fixes some incorrect type annotations in `Scheduler`.
5+
[Daverball]
6+
47
0.7.0 (2023-07-11)
58
~~~~~~~~~~~~~~~~~~~
69

src/libres/db/scheduler.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def allocation_by_id(self, id: int) -> Allocation:
204204

205205
def allocations_by_ids(
206206
self,
207-
ids: _t.Collection[UUID]
207+
ids: _t.Collection[int]
208208
) -> 'Query[Allocation]':
209209
query = self.managed_allocations()
210210
query = query.filter(Allocation.id.in_(ids))
@@ -308,7 +308,7 @@ def allocation_mirrors_by_master(
308308

309309
def allocation_dates_by_ids(
310310
self,
311-
ids: _t.Collection[UUID],
311+
ids: _t.Collection[int],
312312
start_time: _t.Optional[time] = None,
313313
end_time: _t.Optional[time] = None
314314
) -> _t.Iterator[_t.Tuple[datetime, datetime]]:
@@ -322,7 +322,7 @@ def allocation_dates_by_ids(
322322

323323
yield s_dt, e_dt - timedelta(microseconds=1)
324324

325-
def manual_approval_required(self, ids: _t.Collection[UUID]) -> bool:
325+
def manual_approval_required(self, ids: _t.Collection[int]) -> bool:
326326
""" Returns True if any of the allocations require manual approval. """
327327
query = self.allocations_by_ids(ids)
328328
query = query.filter(Allocation.approve_manually == True)
@@ -803,8 +803,10 @@ def move_allocation(
803803
change.reserved_slots[0]
804804
)
805805

806-
if change.is_master and \
807-
change.pending_reservations.count():
806+
if (
807+
change.is_master and
808+
change.pending_reservations.count()
809+
):
808810
raise errors.AffectedPendingReservationError(
809811
change.pending_reservations[0]
810812
)

0 commit comments

Comments
 (0)