build_no_provenance_node_usage has a messy signature because it has to be able to handle either a ProvNode or None as the arg to node (the result of dag.get_node_data). If None, it needs other context to do its job.
None is used, because some dag nodes don't actually have underlying ProvNodes. Consider refactoring ProvNode so that the minimal node has only a UUID. This would probably require ProvNode properties with Optional returns and more if not None checks, but it would allow us to drop some Optional[ProvNode]s too. The semantics feel pretty good. A node is, at least, a UUID, after all.
build_no_provenance_node_usage
has a messy signature because it has to be able to handle either aProvNode
orNone
as the arg tonode
(the result ofdag.get_node_data
). IfNone
, it needs other context to do its job.None is used, because some dag nodes don't actually have underlying ProvNodes. Consider refactoring ProvNode so that the minimal node has only a UUID. This would probably require ProvNode properties with Optional returns and more if not None checks, but it would allow us to drop some
Optional[ProvNode]
s too. The semantics feel pretty good. A node is, at least, a UUID, after all.