Specific error when updating state as an unknown node (#1015)

This commit is contained in:
Nuno Campos
2024-07-14 06:54:01 -07:00
committed by GitHub
parent 3ef65c37b3
commit 8cf10fa460
@@ -555,6 +555,8 @@ class Pregel(
as_node = last_seen_by_node[-1][1]
if as_node is None:
raise InvalidUpdateError("Ambiguous update, specify as_node")
if as_node not in self.nodes:
raise InvalidUpdateError(f"Node {as_node} does not exist")
# update channels
with ChannelsManager(self.channels, checkpoint, config) as channels:
# create task to run all writers of the chosen node
@@ -644,6 +646,8 @@ class Pregel(
as_node = last_seen_by_node[-1][1]
if as_node is None:
raise InvalidUpdateError("Ambiguous update, specify as_node")
if as_node not in self.nodes:
raise InvalidUpdateError(f"Node {as_node} does not exist")
# update channels, acting as the chosen node
async with AsyncChannelsManager(self.channels, checkpoint, config) as channels:
# create task to run all writers of the chosen node