Page MenuHomePhabricator

solid_subset example

Authored by alangenfeld on Oct 28 2019, 4:20 PM.
def test_toggle_pipeline_2():
def generate_a():
return ['A']
def generate_b():
return ['B']
def input_mux(a, b):
if a and b:
return a + b
elif b:
return b
return a
def do_stuff(selected_in):
return len(selected_in)
def selective_pipeline():
# A simpler example but you get the gist
a = generate_a()
b = generate_b()
selected = input_mux(a, b)
# execute a few different selections
selective_pipeline.build_sub_pipeline(solid_subset=['do_stuff', 'input_mux', 'generate_a']),
# We need to provide values via config for the missing inputs, this is kind of annoying and
# points at an improvement to the system that should happen.
'solids': {'input_mux': {'inputs': {'b': {'value': None}}}}
selective_pipeline.build_sub_pipeline(solid_subset=['do_stuff', 'input_mux', 'generate_b']),
environment_dict={'solids': {'input_mux': {'inputs': {'a': {'value': None}}}}},

Event Timeline

alangenfeld changed the visibility from "All Users" to "Public (No Login Required)".
alangenfeld edited the content of this paste. (Show Details)