Skip to content

Commit e494e88

Browse files
committed
focus on task resources
1 parent 308111d commit e494e88

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

distributed/client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3313,7 +3313,7 @@ def _graph_to_futures(
33133313
retries=None,
33143314
fifo_timeout=0,
33153315
actors=None,
3316-
annotations_by_type=None,
3316+
task_resources=None,
33173317
):
33183318
with self._refcount_lock:
33193319
if actors is not None and actors is not True and actors is not False:
@@ -3381,7 +3381,7 @@ def _graph_to_futures(
33813381
"actors": actors,
33823382
"code": ToPickle(computations),
33833383
"annotations": ToPickle(annotations),
3384-
"annotations_by_type": ToPickle(annotations_by_type or {}),
3384+
"task_resources": ToPickle(task_resources),
33853385
"span_metadata": ToPickle(span_metadata),
33863386
}
33873387
)
@@ -3471,7 +3471,7 @@ def get(
34713471
user_priority=priority,
34723472
actors=actors,
34733473
span_metadata=SpanMetadata(collections=[{"type": "low-level-graph"}]),
3474-
annotations_by_type=kwargs.get("annotations_by_type", None),
3474+
task_resources=kwargs.get("task_resources"),
34753475
)
34763476
packed = pack_data(keys, futures)
34773477
if sync:

distributed/scheduler.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -4753,7 +4753,7 @@ async def update_graph(
47534753
fifo_timeout: float = 0.0,
47544754
code: tuple[SourceCode, ...] = (),
47554755
annotations: dict | None = None,
4756-
annotations_by_type: dict | None = None,
4756+
task_resources: dict | None = None,
47574757
stimulus_id: str | None = None,
47584758
) -> None:
47594759
start = time()
@@ -4772,15 +4772,17 @@ async def update_graph(
47724772
(
47734773
dsk,
47744774
dependencies,
4775-
_annotations_by_type,
4775+
annotations_by_type,
47764776
) = await offload(
47774777
_materialize_graph,
47784778
graph=graph,
47794779
global_annotations=annotations or {},
47804780
)
47814781
del graph
4782-
annotations_by_type = _annotations_by_type.update(annotations_by_type or {})
4783-
del _annotations_by_type
4782+
4783+
if task_resources:
4784+
annotations_by_type["resources"].update(task_resources)
4785+
47844786
if not internal_priority:
47854787
# Removing all non-local keys before calling order()
47864788
dsk_keys = set(

0 commit comments

Comments
 (0)