Philip MacMenamin
08/10/2020, 6:36 PMwith Flow("STL Flow") as f:
files = Parameter("files")
f.run(files='fname.txt')
Kyle Moon-Wright
08/10/2020, 6:40 PMPhilip MacMenamin
08/10/2020, 6:42 PMKyle Moon-Wright
08/10/2020, 6:44 PM$ python3 -m vtk_flow.flow
/home/macmenaminpe/.local/lib/python3.8/site-packages/prefect/core/flow.py:349: UserWarning: Tasks were created but not added to the flow: {<Parameter: files>}. This can occur when `Task` classes, including `Parameters`, are instantiated inside a `with flow:` block but not added to the flow either explicitly or as the input to another task. For more information, see <https://docs.prefect.io/core/advanced_tutorials/task-guide.html#adding-tasks-to-flows>.
warnings.warn(
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/macmenaminpe/code/nih-3d-resource-workflows/vtk_flow/flow.py", line 71, in <module>
f.run(files='Cube_3d_printing_sample.stl')
File "/home/macmenaminpe/.local/lib/python3.8/site-packages/prefect/core/flow.py", line 1213, in run
state = self._run(
File "/home/macmenaminpe/.local/lib/python3.8/site-packages/prefect/core/flow.py", line 1032, in _run
flow_state = runner.run(
TypeError: run() got an unexpected keyword argument 'files'
Philip MacMenamin
08/10/2020, 6:45 PMKyle Moon-Wright
08/10/2020, 6:46 PMwith Flow("STL Flow") as f:
files = Parameter(name="files", default='fname.txt')
f.run(parameters={'files': 'some_other_file.txt'})
f.run()
Philip MacMenamin
08/10/2020, 6:50 PMprefect/examples/parameterized_flow.py
as a template.Kyle Moon-Wright
08/10/2020, 6:52 PMPhilip MacMenamin
08/10/2020, 6:52 PMKyle Moon-Wright
08/10/2020, 7:02 PMvalue
is being taken in as an argument for check_if_even
, print_odd
, and print_even
in the flow context as runtime values. These parameter values can be changed in the flow.run()
arguments (which is what I thought you were getting at with your initial snippet), but still need to be passed to other tasks.Philip MacMenamin
08/10/2020, 8:19 PM