-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
In the following diagram, all data are given, and asked
is different, depending on whether we expicitly ask it in the outputs:
- when
asked
output asked, it checksoverriden
is already given and dose not recompute it, - without outputs, it overrides it.
Code to reproduce it:
def test_pruning_not_overrides_given_intermediate():
# Test #25: not overriding intermediate data when an output is not asked
graph = compose(name="graph")(
operation(name="unjustly run", needs=["a"], provides=["overriden"])(lambda a: a),
operation(name="op", needs=["overriden", "c"], provides=["asked"])(add),
)
graph.net.plot('t.png')
assert graph({'a': 5, 'overriden': 1, "c": 2}, ['asked']) == {'asked': 3} # that's ok
assert graph({'a': 5, 'overriden': 1, "c": 2}) == {'a': 5, 'overriden': 1, "c": 2, 'asked': 3} # FAILs
Root cause:
- The code that prunes the predecessors of intermediate data runs only when outputs asked.
- The existing "pruning" TCs were too simple to catch this.
Note that the pruning code in v1.2.4 is buggy (#24), so it cannot be used as is.
Metadata
Metadata
Assignees
Labels
No labels