Replies: 1 comment
-
A quick workaround is to just use set(transport_graph.dirty_nodes) when using it. This avoids having to change the TransportGraph implementation which might have unintended consequences. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Every time transport graph nodes are initialized or updated, the corresponding
node_id
gets appended to theresult.lattice.transport_graph.dirty_nodes
attribute. The latter attribute is a list. When printing out the dirty nodes for a workflow, using the following code snippet:we get,
Updating the node metadata in the database, each time we have duplicate node_id entries seems very inefficient. Should we rather convert dirty _nodes to a
set
in order to avoid the duplication issue and hence writing the same information to the database multiple times?Each time a node is added, in the transport graph object, we simply perform
self.dirty_nodes.add(node_id)
and each time the node data is written to the database, we doresult.lattice.transport_graph.dirty_nodes.remove(node_id)
. If we make this change, the dirty nodes above would simply be:Beta Was this translation helpful? Give feedback.
All reactions