Skip to content

BUG: overriding intermediate data when no outputs asked #25

@ankostis

Description

@ankostis

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 checks overriden 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions