Empty ProvDAGs aren't very useful. Maybe we should refac this as a ParserResults parser. This would mean tools like Union that are basically constructing ParserResults "manually" don't need to create an empty ProvDAG and then overwrite its fields. Instead, they create a ParserResults and once the data's there, they throw it at ProvDAG().
In favor
By requiring tools to actually write ParserResults, we ensure they create all required data, and mypy can check it's correctly typed. This approach may be slightly more efficient, too.
I also don't love that passing no args to ProvDAG is possible, because it seems to encourage this somewhat useless behavior.
Against
The "create an empty object and populate it" idiom is common and familiar... :shrug:
Empty ProvDAGs aren't very useful. Maybe we should refac this as a ParserResults parser. This would mean tools like Union that are basically constructing ParserResults "manually" don't need to create an empty ProvDAG and then overwrite its fields. Instead, they create a ParserResults and once the data's there, they throw it at ProvDAG().
In favor
By requiring tools to actually write ParserResults, we ensure they create all required data, and mypy can check it's correctly typed. This approach may be slightly more efficient, too.
I also don't love that passing no args to ProvDAG is possible, because it seems to encourage this somewhat useless behavior.
Against
The "create an empty object and populate it" idiom is common and familiar... :shrug: