Skip to content

Commit

Permalink
add simple hacks to pass through annotations_by_type
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed Aug 1, 2024
1 parent 564f28b commit 308111d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3313,6 +3313,7 @@ def _graph_to_futures(
retries=None,
fifo_timeout=0,
actors=None,
annotations_by_type=None,
):
with self._refcount_lock:
if actors is not None and actors is not True and actors is not False:
Expand Down Expand Up @@ -3380,6 +3381,7 @@ def _graph_to_futures(
"actors": actors,
"code": ToPickle(computations),
"annotations": ToPickle(annotations),
"annotations_by_type": ToPickle(annotations_by_type or {}),
"span_metadata": ToPickle(span_metadata),
}
)
Expand Down Expand Up @@ -3469,6 +3471,7 @@ def get(
user_priority=priority,
actors=actors,
span_metadata=SpanMetadata(collections=[{"type": "low-level-graph"}]),
annotations_by_type=kwargs.get("annotations_by_type", None),
)
packed = pack_data(keys, futures)
if sync:
Expand Down
5 changes: 4 additions & 1 deletion distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4753,6 +4753,7 @@ async def update_graph(
fifo_timeout: float = 0.0,
code: tuple[SourceCode, ...] = (),
annotations: dict | None = None,
annotations_by_type: dict | None = None,
stimulus_id: str | None = None,
) -> None:
start = time()
Expand All @@ -4771,13 +4772,15 @@ async def update_graph(
(
dsk,
dependencies,
annotations_by_type,
_annotations_by_type,
) = await offload(
_materialize_graph,
graph=graph,
global_annotations=annotations or {},
)
del graph
annotations_by_type = _annotations_by_type.update(annotations_by_type or {})
del _annotations_by_type
if not internal_priority:
# Removing all non-local keys before calling order()
dsk_keys = set(
Expand Down

0 comments on commit 308111d

Please sign in to comment.